C++ Program to Find Quotient and Remainder

#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

Leave a Comment