RosettaCodeData/Task/Arithmetic-Integer/UNIX-Shell/arithmetic-integer-2.sh

8 lines
207 B
Bash

#!/bin/sh
read a; read b;
echo "a+b = $((a+b))"
echo "a-b = $((a-b))"
echo "a*b = $((a*b))"
echo "a/b = $((a/b))" # truncates towards 0
echo "a mod b = $((a%b))" # same sign as first operand