Chipmunk Basic - Computing mod?

ma3088

New member
I'm not sure what the syntax error is all about.
I'm trying to compute the modulus (remainder) of two integers. I have the code below,


Chipmunk BASIC v3.5.8b5
* Copyright (C)2002 by Ronald H Nicholson, Jr. All Rights Reserved *
>5 REM - Computing Mod Func
10 INPUT "a = "; a
20 INPUT "d = "; d
30 q = 0
40 r = abs(a)
50 while(r >= d)
60 r = r - d
70 q = q + 1
80 wend(r <=d)
90 exit while
100 if(a < 0 and r > 0) then
110 r = d - r
120 q = -(q + 1)
130 endif
140 print "Remainder = "; r>>>>>>>>>>>>>>
>run
a = 101
d = 11
Syntax error in line 90
>
 
Back
Top