RosettaCodeData/Task/Count-the-coins/Run-BASIC/count-the-coins.basic

14 lines
398 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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"