Programming Exercises
Use a while loop to convert time in minutes to time in hours and minutes. Use #define or const to create a symbolic constant for 60, and provide a sensible method of ending the loop.
Write a program that asks for an integer and then prints all the integers from (and including) that value up to (and including) a value larger by 10. (That is, if the input is 5, the output runs from 5 to 15.)
Write a program that asks you to enter the number of days and then converts that value to weeks and days. For example, it would convert 18 days to 2 weeks, 4 days.
Change the program addemup.c (refer to Listing 5.13) that found the sum of the first 20 integers. (If you prefer, you can think of addemup.c as a program that calculates how much ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access