Write a C++ Program to Find Quotient and Remainder of 2 numbers. Here’s simple C++ Program to Find Quotient and Remainder of 2 numbers in C++ Programming Language.
In this program, user is asked to enter two integers (divisor and dividend) and computes the quotient and remainder.
To compute quotient and remainder, both divisor and dividend should be integers.
Here is source code of the C++ Program to Find Quotient and Remainder of 2 numbers. The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.
SOURCE CODE : :
/* C++ Program to Find Quotient and Remainder of 2 numbers */
#include <iostream>
using namespace std;
int main()
{
int divisor, dividend, quotient, remainder;
cout << "Enter dividend :: ";
cin >> dividend;
cout << "\nEnter divisor :: ";
cin >> divisor;
quotient = dividend / divisor;
remainder = dividend % divisor;
cout << "\nQuotient = " << quotient << endl;
cout << "\nRemainder = " << remainder<<endl;
return 0;
}
Output : :
/* C++ Program to Find Quotient Remainder of 2 numbers */
Enter dividend :: 1234
Enter divisor :: 5
Quotient = 246
Remainder = 4
Process returned 0
Above is the source code for C++ Program to Find Quotient Remainder of 2 numbers which is successfully compiled and run on Windows System.The Output of the program is shown above .
Here is source code of the C++ Program to Find Quotient and Remainder of 2 numbers. The C++ program is successfully compiled and run(on Codeblocks) on a Windows system. The program output is also shown in below.
SOURCE CODE : :
Output : :
Above is the source code for C++ Program to Find Quotient Remainder of 2 numbers which is successfully compiled and run on Windows System.The Output of the program is shown above .
need an explanation for this answer? contact us directly to get an explanation for this answer