create a program that will ask the user to give a number for the divided and the divisor and then program will compute and display the quotient and its remainder on the screen
// quotient.cpp
// Author: Mr jake R. pomperada, BSCS, MAED- IT
// Date: august 14, 2018 Tuesday
// Location: Bacolod City, Negros occidental
// Website: http://www.jakerpompereda.com
#include <iostream>
using namespace std;
int main()
{
int divided, divisor;
int quotient, remainder;
do
{
cout << "Please, enter the divided (0 - exit program): ";
cin >> divided;
if (divided == 0)break;
cout << "Please, enter the divisor: ";
cin >> divisor;
if (divisor == 0)
{
cout << "Error! Division by zero" << endl;
}
else
{
quotient= divided / divisor;
remainder= divided % divisor;
cout << "Quotient is " << quotient;
cout << "\nRemainder is " << remainder<<endl;
}
} while (true);
}
Comments
thankyou for the wonderful answer my programming sub
Leave a comment