Answer to Question #310301 in C++ for christine traya

Question #310301

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

1
Expert's answer
2022-03-12T12:46:32-0500
#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);
}

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

aikashakira
13.03.22, 03:28

thankyou for the wonderful answer my programming sub

Leave a comment