Jump to content

Ethiopian multiplication: Difference between revisions

(→‎{{header|BASIC}}: Locomotive BASIC example)
Line 308:
 
<lang basic>10 x=17:y=34:tot=0
20 whileWHILE x>=1
30 printPRINT x,
40 ifIF x modMOD 2 thenTHEN tot=tot+y:printPRINT y elseELSE printPRINT
50 x=intINT(x/2):y=2*y
60 wendWEND
70 printPRINT "=", tot</lang>
 
Output:
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.