0% found this document useful (0 votes)
13 views1 page

Program 6 Code

The program takes divisor and dividend as input from the user, calculates the quotient when dividend is divided by divisor and calculates the remainder of the division and prints both the quotient and remainder.

Uploaded by

luuxz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views1 page

Program 6 Code

The program takes divisor and dividend as input from the user, calculates the quotient when dividend is divided by divisor and calculates the remainder of the division and prints both the quotient and remainder.

Uploaded by

luuxz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

/*6.Write a program in C++ to compute quotient and remainder.

*/
#include <iostream>
using namespace std;

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

// input
cout << "Enter divisor: " << endl;
cin >> divisor;
cout << "Enter dividend: " << endl;
cin >> dividend;

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

// print
cout << "quotient : " << quotient<< endl;
cout << "remainder: " << remainder;

return 0;
}

You might also like