Anonymous user
Ethiopian multiplication: Difference between revisions
Replaced all instances of EXIT PROGRAM to GOBACK
(Replaced all instances of EXIT PROGRAM to GOBACK) |
|||
Line 603:
=={{header|COBOL}}==
{{trans|Common Lisp}}
{{works with|COBOL|2002}}
{{works with|OpenCOBOL|1.1}}
In COBOL, ''double'' is a reserved word, so the doubling functions is named ''twice'', instead.
Line 656 ⟶ 657:
END-CALL
END-PERFORM
END PROGRAM ethiopian-multiply.
Line 668 ⟶ 669:
PROCEDURE DIVISION USING n, m.
DIVIDE n BY 2 GIVING m END-DIVIDE
END PROGRAM halve.
Line 680 ⟶ 681:
PROCEDURE DIVISION USING n, m.
MULTIPLY n by 2 GIVING m END-MULTIPLY
END PROGRAM twice.
Line 696 ⟶ 697:
DIVIDE n BY 2 GIVING q REMAINDER m END-DIVIDE
SUBTRACT m FROM 1 GIVING m END-SUBTRACT
END PROGRAM evenp.</lang>
|