Arithmetic/Integer: Difference between revisions
Content added Content deleted
No edit summary |
|||
Line 4,098: | Line 4,098: | ||
"power: ", $a ** $b, "\n"; // PHP 5.6+ only |
"power: ", $a ** $b, "\n"; // PHP 5.6+ only |
||
?></lang> |
?></lang> |
||
=={{header|Picat}}== |
|||
<lang Picat>main => |
|||
X = read_int(), |
|||
Y = read_int(), |
|||
foreach (Op in [+,-,*,div,rem]) |
|||
R = apply(Op,X,Y), |
|||
printf("%d %w %d = %d\n", X, Op, Y, R) |
|||
end. |
|||
</lang> |
|||
{{out}} |
|||
<pre> |
|||
2 3 |
|||
2 + 3 = 5 |
|||
2 - 3 = -1 |
|||
2 * 3 = 6 |
|||
2 div 3 = 0 |
|||
2 rem 3 = 2 |
|||
</pre> |
|||
=={{header|PicoLisp}}== |
=={{header|PicoLisp}}== |