Write a program that input some number of cents (see less than 100), and output the number of quarters, dimes, nickels and pennies needed to add up to that amount (thinking how a cashier needs to return you back some small changes).
NOTE : Take care of the indentation using the screenshot.
CODE :
#quarter = 25 cents
#Dime = 10 cents
#Nickel = 5 cents
#Penny = 1 cent
n = int(input("Enter cents : "))
q = d = ni = p = 0
n = n-25
while n>=0:
q = q + 1
n = n-25
n = n+25
n = n-10
while n>=0:
d = d + 1
n = n-10
n = n+10
n = n-5
while n>=0:
ni = ni + 1
n = n-5
p = n+5
print(q," Quarters, ",d," dimes,",ni," nickels,",p," pennies")
Get Answers For Free
Most questions answered within 1 hours.