Question: #include using namespace std; int main ( ) { int num; int quotient; / / the quotient int base; / / the divisor int remainder;

#include
using namespace std;
int main()
{
int num;
int quotient; // the quotient
int base; // the divisor
int remainder; // the remainder
cout << "Enter a binary number" << endl;
cin >> num;
cout <<" Enter the base "<< endl;
cin >> base;
// calculate the remainder
quotient = num;
while(quotient !=0)
{
remainder = quotient % base;
quotient = quotient / base;
}
cout <<" Display the quotient "<< quotient << endl;
cout <<" Display the remainder "<< remainder << endl;
return 0;
}
This is the Division, Quotient and Remainder method and I need help to write this function to display all the remainders

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!