Ethiopian multiplication: Difference between revisions
Content added Content deleted
(→{{header|Locomotive Basic}}: fixed) |
|||
Line 1,224: | Line 1,224: | ||
=={{header|Locomotive Basic}}== |
=={{header|Locomotive Basic}}== |
||
{{incorrect|Locomotive Basic|Task asks for three functions to be defined and used in the solution.}} |
|||
<lang locobasic>10 |
<lang locobasic>10 DEF FNiseven(a)=(a+1) MOD 2 |
||
20 DEF FNhalf(a)=INT(a/2) |
|||
⚫ | |||
30 DEF FNdouble(a)=2*a |
|||
30 PRINT x, |
|||
40 x=17:y=34:tot=0 |
|||
⚫ | |||
⚫ | |||
50 x=INT(x/2):y=2*y |
|||
60 |
60 PRINT x, |
||
⚫ | |||
⚫ | |||
80 x=FNhalf(x):y=FNdouble(y) |
|||
90 WEND |
|||
⚫ | |||
Output: |
Output: |