Question: Write a C program that converts knuts to sickles and galleons (the currency of the HarryPotter novels).The user will enter the total number of knuts.
Write a C program that converts knuts to sickles and galleons (the currency of the HarryPotter novels).The user will enter the total number of knuts. There are 29 knuts in one sickle and 17 sickles in one galleon.
Hint: Divide the amount by the number of knuts in one galleon to determine the number of galleons, and then reduce the amount by the total value of the galleons (You can also use a remainder operator). Repeat for sickles. Be sure to use integer values throughout, no floating-point numbers.
If the amount entered is less than zero or greater than one billion (1000000000), output an error message and abort the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
