Question #14124

Write a program to read two numbers and print their quotient and remainder.

Expert's answer

#include <iostream>
using namespace std;

int main()
{

int a, b;
cout << "Please input a:" << endl;
cin
>> a;
cout << "Please input b:" << endl;
cin
>> b;

cout << "quotient c = " << (int) (a / b)
<< endl;
cout << "remainder d = " << a % b <<
endl;

return 0;
}
LATEST TUTORIALS
APPROVED BY CLIENTS