C++ Program to Find Quotient and Remainder

Find Quotient and Remainder in C++

What is Quotient(/): According to mathematical definition “a result obtained by dividing one quantity by another.”

What is Remainder (%):a part, number, or quantity that is left over

In this example, you will learn to find the quotient and remainder of a given dividend and divisor.
In this program, user  enter two integers (divisor and dividend) and computes the quotient and remainder.

To compute quotient and remainder, both divisor and dividend should be integers.


Example: Program of  quotient and remainder
#include<iostream>
 #include<conio>
int main()
{     int divisor, dividend, quotient, remainder;
    cout << "Enter dividend: ";
    cin >> dividend;
    cout << "Enter divisor: ";
    cin >> divisor;
    quotient = dividend / divisor;
    remainder = dividend % divisor;
    cout << "Quotient = " << quotient << endl;
    cout << "Remainder = " << remainder;
    getch ();
    return 0;
}
Quotient and Remainder program
Quotient and Remainder program

Comments

Post a Comment

Popular posts from this blog

HFC TRADDING APP SCAM [People Lost Millions of their hard earned]

Binance Beginners Guide | Trading, Future trading, Us Margin

The 8 best ecommerce platforms to create your online store in 2020