The World of Numbers

Problem Statement

Given two integers, X and Y, find their sum, difference, product, and quotient.

Input Format
Two lines containing one integer each (X and Y, respectively).

Input Constraints
100X,Y100
Y0

Output Format
Four lines containing the sum (X+Y), difference (XY), product (X×Y), and quotient (XY), respectively.
(While computing the quotient, print only the integer part.)

Sample Input

5  
2

Sample Output

7
3
10
2

Reference Resources
A relevant and interesting discussion on Stack-Exchange for those getting started with handling numbers and arithmetic operations in Bash.

Solution

  
read a
read b
echo $(($a+$b))
echo $(($a-$b))
echo $(($a*$b))
echo $(($a/$b))


Leave a Reply