RosettaCodeData/Task/Count-the-coins/Run-BASIC/count-the-coins.basic
2023-07-01 13:44:08 -04:00

13 lines
398 B
Text

for penny = 0 to 100
for nickel = 0 to 20
for dime = 0 to 10
for quarter = 0 to 4
if penny + nickel * 5 + dime * 10 + quarter * 25 = 100 then
print penny;" pennies ";nickel;" nickels "; dime;" dimes ";quarter;" quarters"
count = count + 1
end if
next quarter
next dime
next nickel
next penny
print count;" ways to make a buck"