Challenge 32

Write a program to ask a rocket launch controller to input a number of hours as an integer between 50 and 100. Convert this to days and hours and print the results in the format:

Launch in xx days, xx hours.

Answer :

Final answer:

To convert hours to days and hours, divide the input number by 24 and take the remainder. Print the result in the specified format.


Explanation:

To convert the input number of hours to days and hours, you need to divide the number by 24 to get the number of days. Then, take the remainder of the division and that will give you the number of hours left. Finally, you can print the result in the format 'Launch in xx days, xx hours.'

For example, if the input number is 74, you can divide it by 24 to get 3 days and a remainder of 2 hours. Therefore, the program should output 'Launch in 3 days, 2 hours.'


Learn more about Converting hours to days and hours here:

https://brainly.com/question/15075067