Answer to Question #98764 in C++ for bilal

Question #98764
write a c++ program that asks the user to enter two numbers: a dividend and a divisor. it the calculates the quotient and the remainder. loop the program to infinity.
1
Expert's answer
2019-11-17T12:14:19-0500
#include <iostream>

using namespace std;

int main()
{
  int dividend, divisor, quotient, remainder;
  while(1)
  {
    cout << "\tPlease, enter dividend and divisor!" << endl << "Dividend : ";
    cin >> dividend;
    cout << "Divisor : ";
    cin >> divisor;
    quotient = dividend/divisor;
    remainder = dividend%divisor;
    cout << "Quotient = " << quotient << "\tRemainder = " << remainder << endl;
  }
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS