Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobierenF&A Diskussionen
When 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 AntwortenWher is mistake?
0 Stimmen
5 AntwortenHeute heiß
Is there anyone help me to make a code I can't understand how to build it so anyone help me plz.
0 Votes
Help
0 Votes
help
0 Votes
About code
1 Votes
Quick question 🤔
1 Votes
Let Const Var
2 Votes
I need some help
1 Votes
debugging course
1 Votes
How to mentione names in code?
1 Votes
Code not working
0 Votes