Struggling with PS2, P3. I can't debug the following program. Can anyone help?
n=1
a=0
b=0
c=0
while n<50: # when n=6,
for c in range (0,3): # and c=0,
remainder = n-(20*c) # remainder=6
for b in range (0,6): # and b=0
a = remainder-(9*b) # a=6
a = a/6 # a=1
if 6*a + 9*b + 20*c == n:
# 6(1) + 9(0) + 20(0) = 6, right?
print n," can be bought"
n += 1
print n," cannot be bought"
n += 1

Hey! We 've verified this expert answer for you, click below to unlock the details :)

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

Looking for something else?

Not the answer you are looking for? Search for more explanations.

## More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.