C++ Program To Find Quotient And Remainder Of Number

Write C++ code to find quotient and remainder of the given number

// Write C++ code to find quotient and remainder of the given number

#include <bits/stdc++.h>
using namespace std ;

int main()
{
    int dividend, divisor, quotient, remainder;

    cout << "Enter the dividend number :--> " ;
    cin >> dividend ;

    cout << "Enter the divisor number :--> ";
    cin >> divisor ;

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

    cout << "Quotient :--> " << quotient << endl ;
    cout << "Remainder :-->" << remainder << endl ;

    return 0 ;
}

Output:

Enter the dividend number :--> 56
Enter the divisor number :--> 45

Quotient :--> 1
Remainder :-->11

<< Previous | Next >>