//wap in c++ to find quitient ,reminder untill 'no'is entered by user using do while loop
Coding:-
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,d;
char ch;
do{
cout<<"enter dividend";
cin>>a;
cout<<"enter divisor";
cin>>b;
c=a/b;
d=a%b;
cout<<"quotient="<<c<<"\n";
cout<<"reminder="<<d<<"\n";
cout<<"you want to do any other calculations please enter y or n ";
cin>>ch;
}
while(ch!='n');
getch();
}
Output:-
Coding:-
#include<iostream.h>
#include<conio.h>
void main()
{
int a,b,c,d;
char ch;
do{
cout<<"enter dividend";
cin>>a;
cout<<"enter divisor";
cin>>b;
c=a/b;
d=a%b;
cout<<"quotient="<<c<<"\n";
cout<<"reminder="<<d<<"\n";
cout<<"you want to do any other calculations please enter y or n ";
cin>>ch;
}
while(ch!='n');
getch();
}
Output:-
No comments:
Post a Comment