PRF0103 - Division

no tags 

Write a program that allows user to enter two integers called m and n then calculates the value of m divided by n.

Before dividing, the program must check whether the denominator is zero.

Example 1:

Please enter numerator: 7

Please enter denominator: 0

The denominator can’t be zero!

Example 2:

Please enter numerator: -8

Please enter denominator: -5

Result: -8 / -5 = 1.600000

Example 3:

Please enter numerator: 10

Please enter denominator: -2

Result: 10 / -2 = -5.000000


hide comments
Mostafa 36a2: 2022-09-11 12:46:26

Those problems are a waste of time, because of the input/output bugs.
@khanhvh please fix the output files

sabkx: 2021-11-06 13:19:22

Would the author please give an input and output format thanks?


Added by:khanhvh
Date:2020-10-15
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All