Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 1.04 KB

README.md

File metadata and controls

29 lines (24 loc) · 1.04 KB

Find Quotient and Remainder

C Program that could find out and Compute Quotient and Remainder in a division operation

Test Case as output in this program

Case: 1

Enter dividend: 49
Enter divisor: 0
Undefined
Can not divide by zero

Case: 2

Enter dividend: 25
Enter divisor: 5
Quotient = 5
Remainder = 0

Case: 3

Enter dividend: 23
Enter divisor: 7
Quotient = 3
Remainder = 2

How does this program work?

  • In this program, the user is asked to enter two integers (dividend and divisor). They have stored in variables dividend and divisor respectively.
  • If the user gives input zero in the divisor stage then the program will execute. Because numbers can not be divided zero in math.
  • Then the quotient is evaluated using / (the division operator), and stored in quotient
  • Similarly, the remainder is evaluated using % (the modulo operator) and stored in the remainder
  • Finally, the quotient and remainder are displayed as output