Sunday, April 12, 2020

c++ program to compute quotient and remainder

C++ Program to Compute Quotient and Remainder

#include 
using namespace std;

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;

    return 0;
}

Output

Enter dividend : 22
Enter divisor : 4
Quotient : 5
Remainder : 2

Happy Coding


Thanks for visiting my Blog.

Have any problem, feel free to contact us via Email : uoslondy@gmail.com

Have a good day!

0 comments:

Post a Comment

Recent Posts