Write a program in python that accepts a time as an hour and minute. Add 15 minutes to the time, and output the result.
Answers
Answered by
0
Answer:
The below program is written in python where we are taking inputs from the users and then operate the time with their corresponding field.
now we are checking that the minute is greater than 60 or not if it is then operate the if block otherwise the else block.
inputhour= float(input("Input the hour "))
inputminute= float(input("Input the minute"))
hour = inputhour
minute = inputminute +15
if ( minute > 60 )
{hour = hour + (minute/60)
minute= minute %60
resulttime = hour + minute
}
else {
resulttime = hour +minute
}
print("rs-> %d" % (resulttime))
Similar questions
Business Studies,
5 months ago
Computer Science,
5 months ago
Math,
5 months ago
Math,
10 months ago
Math,
1 year ago
Science,
1 year ago