+ 4

How to write a program on how many seconds in a day?please help?

27th Nov 2017, 8:14 AM
alikhan124
alikhan124 - avatar
4 Respuestas
+ 6
cout << 24 * 60 * 60;
27th Nov 2017, 8:27 AM
Vukan
Vukan - avatar
+ 5
There are 60 seconds in a minute and 60 minutes in an hour and 24 hours in a day. So: int secondsInDay = 60 * 60 * 24;
27th Nov 2017, 8:27 AM
ChaoticDawg
ChaoticDawg - avatar
+ 1
For the current second count: #include <ctime> #include <iostream> int main() { std::cout << std::time(0) % (24 * 60 *60); }
27th Nov 2017, 10:48 AM
Timon Paßlick
0
iOStream ??
30th Nov 2017, 4:43 AM
Ragul Raju
Ragul Raju - avatar