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

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



Join the forum, it's quick and easy

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

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

CyberCodes
Would you like to react to this message? Create an account in a few clicks or log in to continue.

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

Go down

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

Post by princeterror 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;
}
princeterror
princeterror
Universal Moderator
Universal Moderator

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

Back to top Go down

Back to top


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