Dyskusje Q&A
can someone explain?
0 głosów
4 odpowiedziIntroduce Code moderation
8 głosów
3 odpowiedziWhen 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 głosów
4 odpowiedziWhen 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 głosów
2 odpowiedziPopularne dzisiaj
How to use the get() method
3 Votes
Game Dev Path
3 Votes
How to get account back?
1 Votes
So this what I'm trying to solve
2 Votes
PHP Tutorial Idea
1 Votes
Problem whit Javascript
1 Votes