Given two numbers A and B. The task is to write a program to find the quotient and remainder of these two numbers when A is divided by B.
Input: A = 2, B = 6 Output: Quotient = 0, Remainder = 2 Input: A = 17, B = 5 Output: Quotient = 3, Remainder = 2
In the below program, to find the quotient and remainder of the two numbers, the user is first asked to enter two numbers. The inputs are scanned using the scanf() function and stored in the variables and . Then, the variables and are divided using the arithmetic operator to get the quotient as result stored in the variable quotient; and using the arithmetic operator % to get the remainder as result stored in the variable remainder.
Below is the programs to find the quotient and remainder of two numbers:
Enter two numbers A and B : 17 5 Quotient when A/B is: 3 Remainder when A/B is: 2
- Program to find Quotient And Remainder in Java
- Program to compute Log n
- C/C++ Program to Find remainder of array multiplication divided by n
- Program to compute division upto n decimal places
- Minimum number of operations on a binary string such that it gives 10^A as remainder when divided by 10^B
- C program to print a string without any quote (singe or double) in the program
- C Program for Program to find area of a circle
- Lex Program to remove comments from C program
- C Program for Program for array rotation
- C program to detect tokens in a C program
- How to compile 32-bit program on 64-bit gcc in C and C++
- How does a C program executes?
- C Program for Cutting a Rod | DP-13
- Program for n-th odd number
- Program for n-th even number
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.