Anonymous user
Ethiopian multiplication: Difference between revisions
→{{header|Locomotive Basic}}: fixed
(→{{header|Locomotive Basic}}: fixed) |
|||
Line 1,224:
=={{header|Locomotive Basic}}==
<lang locobasic>10
20 DEF FNhalf(a)=INT(a/2)
20 WHILE x>=1▼
30 DEF FNdouble(a)=2*a
40 x=17:y=34:tot=0
40 IF x MOD 2 THEN tot=tot+y:PRINT y ELSE PRINT▼
60
70 PRINT "=", tot</lang>▼
80 x=FNhalf(x):y=FNdouble(y)
90 WEND
Output:
|