CyberCodes

Reminders sa mga rehistradong myembro:

•ang lengwahe na gagamitin ay pawang english at tagalog lamang

•Bawal po dito ang pakikipag away

•Bawal ang mga shorcut na mga words
Example: txt, Pwd, at iba pa

•Bawal mababastos at masasakit na salita o anu mang makakasakit
ng damdamin ng isang myembro ng forum na ito

•use the "like" button if the post of the following user you think are usefull


Days, Hours, Minutes, and Seconds in C++

Go down

Admin Post Days, Hours, Minutes, and Seconds in C++

Post by princeterror on Fri Jan 11, 2013 5:44 am

OUTPUT:

Enter the number of days: ___________

"_________ Days is equal to ________ Hours."
"_________ Days is equal to ________ Minutes."
"_________ Days is equal to ________ Seconds."

Answer:
Code:
# include <iostream>

using namespace std;

int main()
{
    int d,hrs=24,mins=60,secs=60;
    cout<<"Enter the number of days: ";
    cin>>d;
    cout<<endl<<endl;

    cout<<d<<" Days is equal to "<<d*hrs<<" Hours."<<endl;
    cout<<d<<" Days is equal to "<<d*hrs*mins<<" Minutes."<<endl;
    cout<<d<<" Days is equal to "<<d*hrs*mins*secs<<" Seconds."<<endl;

    //system("pause");
    return 0;
}
avatar
princeterror
Universal Moderator
Universal Moderator

Posts : 272
Credits : 11465
Fame : 81
Join date : 2012-06-07
Age : 26

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum