Sha256: 8052ca3640f9ed73246176cc1943cbf2b2ad9c92ba852d991336dd696283734f

Contents?: true

Size: 910 Bytes

Versions: 10

Compression:

Stored size: 910 Bytes

Contents

MODULE ints;

IMPORT  InOut;

VAR     a, b    : INTEGER;

BEGIN
  InOut.WriteString ("Enter two integer numbers : ");   InOut.WriteBf;
  InOut.ReadInt (a);
  InOut.ReadInt (b);
  InOut.WriteString ("a + b   = ");  InOut.WriteInt (a + b, 9);    InOut.WriteLn;
  InOut.WriteString ("a - b   = ");  InOut.WriteInt (a - b, 9);    InOut.WriteLn;
  InOut.WriteString ("a * b   = ");  InOut.WriteInt (a * b, 9);    InOut.WriteLn;
  InOut.WriteString ("a / b   = ");  InOut.WriteInt (a DIV b, 9);  InOut.WriteLn;
  InOut.WriteString ("a MOD b = ");  InOut.WriteInt (a MOD b, 9);  InOut.WriteLn;
  InOut.WriteLn;
END ints.Producing:$$ ints
Enter two integer numbers : 12 7
a + b   =        19
a - b   =         5
a * b   =        84
a / b   =         1
a MOD b =         5

$$ ints
Enter two integer numbers : 123 -111
a + b   =        12
a - b   =       234
a * b   =    -13653
a / b   =        -1
a MOD b =        12

Version data entries

10 entries across 7 versions & 1 rubygems

Version Path
zettacode-0.1.7 files.zettacode/arithmetic.integer/modula-2.txt
zettacode-0.1.6 files.zettacode/arithmetic.integer/modula-2.txt
zettacode-0.1.6 files.zettacode2/arithmetic.integer/modula-2.txt
zettacode-0.1.5 files.zettacode/arithmetic.integer/modula-2.txt
zettacode-0.1.5 files.zettacode2/arithmetic.integer/modula-2.txt
zettacode-0.1.4 files.zettacode/arithmetic.integer/modula-2.txt
zettacode-0.1.4 files.zettacode2/arithmetic.integer/modula-2.txt
zettacode-0.1.3 files.zettacode/arithmetic.integer/modula-2.txt
zettacode-0.1.2 files.zettacode/arithmetic.integer/modula-2.txt
zettacode-0.1.1 zettacode.files/arithmetic.integer/modula-2.txt