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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!