C++ Program to Find Quotient and Remainder Last Updated : 23 Jul, 2025 Comments Improve Suggest changes 4 Likes Like Report Here, we will see how to find the quotient and remainder using a C++ program. The quotient is the result of dividing a number (dividend) by another number (divisor). The remainder is the value left after division when the dividend is not completely divisible by the divisor. For example, The Modulo Operator will be used to calculate the Remainder and Division Operator will be used to calculate the Quotient. Quotient = Dividend / Divisor; Remainder = Dividend % Divisor; C++ Program to Find Quotient and Remainder C++ // C++ program to find quotient // and remainder #include <iostream> using namespace std; // Driver code int main() { int Dividend, Quotient, Divisor, Remainder; cout << "Enter Dividend & Divisor: "; cin >> Dividend >> Divisor; // Check for division by zero if (Divisor == 0) { cout << "Error: Divisor cannot be zero." << endl; } else { Quotient = Dividend / Divisor; Remainder = Dividend % Divisor; cout << "The Quotient = " << Quotient << endl; cout << "The Remainder = " << Remainder << endl; } return 0; } OutputEnter Dividend & Divisor: The Quotient = 0 The Remainder = 32767Complexity AnalysisTime Complexity: O(1)Auxiliary Space: O(1) Note: If Divisor is '0' then it will show Error: Divisor cannot be zero. Related ArticlesFind the Quotient and Remainder of two integers without using division operatorsProgram for quotient and the remainder of big numberPython Program to find the Quotient and Remainder of two numbersProgram to find Quotient And Remainder in Java Create Quiz CPP Program to Find Quotient and Remainder Comment A ayonssp Follow 4 Improve A ayonssp Follow 4 Improve Article Tags : C++ Programs C++ C Basic Programs Explore C++ BasicsIntroduction to C++3 min readData Types in C++6 min readVariables in C++4 min readOperators in C++9 min readBasic Input / Output in C++3 min readControl flow statements in Programming15+ min readLoops in C++7 min readFunctions in C++8 min readArrays in C++8 min readCore ConceptsPointers and References in C++5 min readnew and delete Operators in C++ For Dynamic Memory5 min readTemplates in C++8 min readStructures, Unions and Enumerations in C++3 min readException Handling in C++12 min readFile Handling in C++8 min readMultithreading in C++8 min readNamespace in C++5 min readOOP in C++Object Oriented Programming in C++8 min readInheritance in C++6 min readPolymorphism in C++5 min readEncapsulation in C++3 min readAbstraction in C++4 min readStandard Template Library(STL)Standard Template Library (STL) in C++3 min readContainers in C++ STL2 min readIterators in C++ STL10 min readC++ STL Algorithm Library3 min readPractice & ProblemsC++ Interview Questions and Answers1 min readC++ Programming Examples4 min read Like