Arithmetic/Integer: Difference between revisions

Add Bash example
(Add Bash example)
Line 171:
print ($1 % $2)
exit}</lang>
=={{header|Bash}}==
<lang bash>read -p "Enter x and y: " x y
 
echo "Sum: $((x+y))"
echo "Difference: $((x-y))"
echo "Product: $((x*y))"
echo "Quotient: $((x/y))" # truncates toward zero
echo "Remainder: $((x%y))" # same sign as first operand</lang>
 
=={{header|BASIC}}==
{{works with|QuickBasic|4.5}}
Line 183 ⟶ 192:
 
Remainder sign matches: first operand
 
=={{header|Befunge}}==
<lang befunge>&&00p"=A",,:."=B ",,,00g.55+,v
Anonymous user