- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# C++ Program to Find Quotient and Remainder

Quotient and Remainder are parts of division along with dividend and divisor.

The number which we divide is known as the dividend. The number which divides the dividend is known as the divisor. The result obtained after the division is known as the quotient and the number left over is the remainder.

dividend = divisor * quotient + remainder

For Example: If 15 is divided by 7, then 2 is the quotient and 1 is the remainder. Here, 15 is the dividend and 7 is the divisor.

15 = 7 * 2 + 1

A program to find quotient and remainder is as follows:

## Example

#include <iostream> using namespace std; int main() { int divisor, dividend, quotient, remainder; dividend = 15; divisor = 7; quotient = dividend / divisor; remainder = dividend % divisor; cout << "Dividend is " << dividend <<endl; cout << "Divisor is " << divisor <<endl; cout << "Quotient is " << quotient << endl; cout << "Remainder is " << remainder; return 0; }

## Output

Dividend is 15 Divisor is 7 Quotient is 2 Remainder is 1

In the above program, the quotient is obtained by dividing the dividend by the divisor. The remainder is obtained by using the modulus operator on dividend and divisor.

quotient = dividend / divisor; remainder = dividend % divisor;

After that the dividend, divisor, quotient and remainder are displayed.

cout << "Dividend is " << dividend <<endl; cout << "Divisor is " << divisor <<endl; cout << "Quotient is " << quotient << endl; cout << "Remainder is " << remainder;

- Related Questions & Answers
- Program to find Quotient and Remainder in Java
- Java program to compute Remainder and Quotient
- C Program to Compute Quotient and Remainder?
- Java Program to Compute Quotient and Remainder
- C++ Program for quotient and remainder of big number
- Python Program to Read Two Numbers and Print Their Quotient and Remainder
- Golang Program to Read Two Numbers and Print their Quotient and Remainder
- Return element-wise quotient and remainder simultaneously in Python Numpy
- Divide a given scalar element with masked array elements and return arrays with Quotient and Remainder in NumPy
- Divide masked array elements by a given scalar element and return arrays with Quotient and Remainder in NumPy
- remainder() in C++ program
- Program to find remainder without using modulo or % operator in C++
- C# program to accept two integers and return the remainder
- How to find element-wise remainder in PyTorch?
- Program to find remainder when large number is divided by 11 in C++

Advertisements