Write a program that accepts a time as an hour and minute. Add 15 minutes to the time, and output the result. python code
Answers
Answered by
0
Answer:
Here we are taking two inputs one in hour anther for minute
then we are adding the extra time only with the minute
Then we are checking if the minute is crossing 60 or not if not then add the hours and minutes if it is then divide the minute by 60 and add the result with the hour and remainder with minute
timeinhour = int(input("Input the hour: "))
timeinminute = int(input("Input the minute: "))
extra = 15
totalminute = timeinminute +extra
if (totalminute <=60)
{ totaltime = timeinhour +totalminute
}
else
{ int m = totalminute % 60
timeinhour = timeinhour +(totalminute /60)
totaltime = timeinhour +m
}
print("totaltime-> %d" % (totaltime))
Similar questions
Hindi,
5 months ago
English,
5 months ago
Social Sciences,
5 months ago
World Languages,
11 months ago
Political Science,
11 months ago