easyUnit 1 · Basics, Input/Output & Operators
P2. Integer Operations
Basics, Input/Output & Operators
Read two integers a and b, and print the result of each arithmetic operator on them.
Input Format
- Line 1:
a - Line 2:
b
Output Format
- Line 1:
Sum: <a + b> - Line 2:
Difference: <a - b> - Line 3:
Product: <a * b> - Line 4:
Division: <a / b>rounded to 2 decimal places - Line 5:
Floor Division: <a // b> - Line 6:
Modulus: <a % b>
Constraints
- -1000 ≤
a,b≤ 1000 b≠ 0
Sample Test Cases
Sample 1
Input
17 5
Output
Sum: 22 Difference: 12 Product: 85 Division: 3.40 Floor Division: 3 Modulus: 2
Sample 2
Input
-7 2
Output
Sum: -5 Difference: -9 Product: -14 Division: -3.50 Floor Division: -4 Modulus: 1
Submitting checks 2 sample cases and 4 hidden test cases.