Question: Write a program that reads 2 numbers as integers, then calculates and prints the results of both integer division and real division operations of these
Write a program that reads 2 numbers as integers, then calculates and prints the results of both integer division and real division operations of these numbers. The real division output should have 2 digits after the decimal part.
Hint: AT LEAST one operand should be double or float for the real division with the fraction part.
Input Format
A single line containing the first integer value (n) as a dividend and the second integer value (m) as a divisor.
Constraints
-100n 100
0<m 100
Output Format
When the input value n=13 and m=4:
- Print Integer division result is 3
- Print Real division result is 3.25
Sample Input 0
13 4
Sample Output 0
Integer division result is 3 Real division result is 3.25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
