Sha256: 577430cf2ddf78dec9d15450b64190e708429fd2403675a46dcc51203e46f3c9
Contents?: true
Size: 538 Bytes
Versions: 10
Compression:
Stored size: 538 Bytes
Contents
program IntegerArithmetic; {$APPTYPE CONSOLE} uses SysUtils, Math; var a, b: Integer; begin a := StrToInt(ParamStr(1)); b := StrToInt(ParamStr(2)); WriteLn(Format('%d + %d = %d', [a, b, a + b])); WriteLn(Format('%d - %d = %d', [a, b, a - b])); WriteLn(Format('%d * %d = %d', [a, b, a * b])); WriteLn(Format('%d / %d = %d', [a, b, a div b])); // rounds towards 0 WriteLn(Format('%d %% %d = %d', [a, b, a mod b])); // matches sign of the first operand WriteLn(Format('%d ^ %d = %d', [a, b, Trunc(Power(a, b))])); end.
Version data entries
10 entries across 7 versions & 1 rubygems