num=12
((num++)) # This just does the arithmetic expansion, which changes num, so has an effect.
echo "num is $num"
((num % 3)) # This just does the arithmetic expansion, which does NOT change num, so has no effect.
echo "num is $num"
echo mod: $((num % 3)) # what does this do? What if you leave out the $?
num2=$((num++)) # This substitutes the result, so sets num2 and changes num
echo "num is $num, num2 is $num2"
num2=$((num % 3)) # This substitutes the result, so sets num2, but does not change num
echo "num is $num, num2 is $num2"