C++ Online Compiler
Example: Find Quotient and Remainder in C++ language
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// Find Quotient and Remainder in C++ language #include <iostream> using namespace std; int main() { int dn, dr, qu, rem; // dn - denotes the dividend // dr - denotes the divisor // qu -denotes the Quotient // rem - denotes the remainder cout << "-----Enter the dividend & divisor to compute the quotient and remainder-----\n"; cin >> dn >> dr; // Computes the quotient qu = dn / dr; // Computes the remainder rem = dn % dr; cout << "\nThe Quotient is " << qu << "\n"; cout << "The Remainder is " << rem << "\n"; return 0; }
34 23
Output
Clear
ADVERTISEMENTS