Discussions Q&R
When I enter two numbers the sum comes.. but when I input character as yes not y... Then it goes into an infinite loop... can anyone explain why?
int a,b;
char ch;
do
{
cout<<"Enter two numbers: ";
cin>>a>>b;
cout<<"The sum is "<<a+b
<<"\nDo you want to try again (y/n): ";
cin>>ch;
}while(ch=='Y'||ch=='y');
0 Vote
2 RéponsesAujourd'hui en vedette
Inner .html
0 Votes
Lesson on Robotics
1 Votes
Tic tak toe
1 Votes
Hyperlink and tests
0 Votes
About this app
1 Votes
Kamal Hinduja Switzerland : How long does it typically take to complete a course on Solo Learn?
0 Votes
Ha
0 Votes
How to Claim it
0 Votes
Mazen
0 Votes