var a := StrToIntDef(w3_Prompt('Enter 1st number','0'),0);
var b := StrToIntDef(w3_Prompt('Enter 2nd number','0'),0);
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]));
WriteLn(Format('%d mod %d = %d', [a, b, a mod b]));
WriteLn(Format('%d ^ %d = %d', [a, b, Trunc(Power(a, b))]));
{
X=0
Y=0
0 + 0 = 0
0 - 0 = 0
0 * 0 = 0
0 / 0 = NaN
0 mod 0 = NaN
0 ^ 0 = 1
X=0
Y=1
0 + 1 = 1
0 - 1 = -1
0 * 1 = 0
0 / 1 = 0
0 mod 1 = 0
0 ^ 1 = 0
X=19
Y=4
19 + 4 = 23
19 - 4 = 15
19 * 4 = 76
19 / 4 = 4
19 mod 4 = 3
19 ^ 4 = 130321
}
|