F&A Diskussionen
How many Americans are here.?
2 Stimmen
2 Antwortencan someone explain?
0 Stimmen
4 AntwortenIntroduce Code moderation
8 Stimmen
3 AntwortenWhen I enter two numbers the sum is displayed.. 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 Stimmen
4 AntwortenWhen 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 Stimmen
2 AntwortenHeute heiß
Audio adding
1 Votes
playground input
0 Votes
What is problem in this code
0 Votes
Stuck in Quize
1 Votes
Software developer
0 Votes
C Program
0 Votes
How I can use div
0 Votes
TIPS From Veterans
1 Votes