simple calculator via loop

//calculor.cpp
//divide two number and find their quotient and remainder
#include<iostream>
using namespace std;
void main()
{
long dividend,divisor;
char ch;
do
{
cout<<"\nEnter dividend:";cin>>dividend;
cout<<"\nEnter divisor:";cin>>divisor;
cout<<"\nQuotient is:"<<dividend/divisor;
cout<<"\nremainder is:"<<dividend%divisor;
cout<<"\n Do another?(y/n):";
cin>>ch;
}
while(ch!='n');

}

here out put:
Enter dividend:5
enter divisor:2
Quotient is:2
remainder is:1
Do another?(y/n)
Last edited on
Is this a question?
Main should have a type int, and return an int. Main should not have a type void.
Last edited on
Topic archived. No new replies allowed.