Days, Hours, Minutes, and Seconds in C++
Page 1 of 1
Days, Hours, Minutes, and Seconds in C++
OUTPUT:
Enter the number of days: ___________
"_________ Days is equal to ________ Hours."
"_________ Days is equal to ________ Minutes."
"_________ Days is equal to ________ Seconds."
Answer:
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- Universal Moderator
- Posts : 272
Credits : 11465
Fame : 81
Join date : 2012-06-07
Age : 33
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum