Arithmetic/Integer: Difference between revisions

Line 887:
INPUT("Enter another number ",B)
 
PRINT("Addition ";A;"+";B;"= ";(A+B))
PRINT("Subtraction ";A;" - ";B;"= ";(A-B))
PRINT("Multiplication ";A;" * ";B;"= ";(A*B))
PRINT("Integer division ";A;" div ";B;"= ";(A DIV B))
PRINT("Remainder or modulo ";A;" mod ";B;"= ";(A MOD B))
PRINT("Power ";A;" ^ ";B;"= ";(A^B))
END PROGRAM
</lang>
Line 898:
<pre>Enter a number ? 12
Enter another number ? 5
Addition 12 + 5 = 17
Subtraction 12 - 5 = 7
Multiplication 12 * 5 = 60
Integer division 12 div 5 = 2
Remainder or modulo 12 mod 5 = 2
Power 12 ^ 5 = 248832
</pre>
Truncate towards: 0
 
Remainder sign matches: first operand
 
Anonymous user