Arithmetic/Integer: Difference between revisions

Modula-3
No edit summary
(Modula-3)
Line 294:
format "Quotient: %\n" (x / y)
format "Remainder: %\n" (mod x y)
 
=={{header|Modula-3}}==
<lang modula3>MODULE Arith EXPORTS Main;
 
IMPORT IO, Fmt;
 
VAR a, b: INTEGER;
 
BEGIN
a := IO.GetInt();
b := IO.GetInt();
IO.Put("a+b = " & Fmt.Int(a + b) & "\n");
IO.Put("a-b = " & Fmt.Int(a - b) & "\n");
IO.Put("a*b = " & Fmt.Int(a * b) & "\n");
IO.Put("a DIV b = " & Fmt.Int(a DIV b) & "\n");
IO.Put("a MOD b = " & Fmt.Int(a MOD b) & "\n");
END Arith.</lang>
 
=={{header|OCaml}}==
Anonymous user