Hi, i'm trying to write a simple program without using the time function. The program will ask user for current time, then it will add 1 sec to the time and display the time. How to add the 1 sec and also add the change to minutes and hours? and without using if statements.
You can use integer division (//) and modulo (%)
When the user input a time, convert this time in seconds
10:53:32 => 39212
Then you can add what you want
Then convert it again
A simple hint : 39212 % 60 == 32 (number of seconds)
Good luck ;)
Replit helper here !
If you found my answer helpful, you can upvote it :)