Simple Calculator
You are given two integers A and B.
Calculate and print their sum, difference (A - B), product, integer quotient (A / B), and remainder (A % B), in that order.
Integer division discards the fractional part. For example, 7 / 2 = 3. B is always greater than zero.
Input
The input contains two space-separated integers A and B.
Output
Print five integers separated by a single space: the sum, difference, product, quotient, and remainder. Print the results without labels or trailing spaces.
Example 1:
Input:
7 2
Output:
9 5 14 3 1
Explanation:
For A = 7 and B = 2, the sum is 9, difference is 5, product is 14, quotient is 3, and remainder is 1.
Example 2:
Input:
10 3
Output:
13 7 30 3 1
Explanation:
For A = 10 and B = 3, the sum is 13, difference is 7, product is 30, quotient is 3, and remainder is 1.
Now Your Turn!
Pick the correct output for the given inputInput:
6 4
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 0 <= A <= 1000
- 1 <= B <= 1000