Arithmetic/Integer: Difference between revisions

Content added Content deleted
Line 21: Line 21:
end Integer_Arithmetic;</ada>
end Integer_Arithmetic;</ada>


=={{header|ALGOL 68}}==
<pre>main:(
LONG INT a=355, b=113;
printf(($"a+b = "gl$, a + b));
printf(($"a-b = "gl$, a - b));
printf(($"a*b = a&times;b = "gl$, a * b));
printf(($"a/b = "gl$, a / b));
printf(($"a OVER b = a%b = a&divide;b = "gl$, a % b));
printf(($"a MOD b = a%*b = a%&times;b = a&divide;&times;b = a&divide;*b = "gl$, a %* b));
printf(($"a UP b = a**b = a&uarr;b = "gl$, a ** b))
)</pre>Output:<pre>a+b = +468
a-b = +242
a*b = a&times;b = +40115
a/b = +3.141592920353982300884955752e +0
a OVER b = a%b = a&divide;b = +3
a MOD b = a%*b = a%&times;b = a&divide;&times;b = a&divide;*b = +16
a UP b = a**b = a&uarr;b = +1.499007808785573768814747570e+288</pre>
=={{header|AWK}}==
=={{header|AWK}}==
<pre>/[0-9]* [0-9]*/{ print ($1 + $2)
<pre>/[0-9]* [0-9]*/{ print ($1 + $2)