Code: Select all
10 input "please enter number then divisor ";z,d
20 print z; "/"; d; "=";: gosub 63000: print c; "remainder"; z
30 end
62990 rem c will count how many times z divides into d and
62995 rem z will be the remainder (modulo) answer
63000 c=0: for i=-1 to 0: z=z-d: c=c+1 : i=z=>d: next: return
Code: Select all
z=40: d=6: gosub 63000: if z<>4 then print "oops... cbm does not maths very well"
Shaun.