Q&A Discussies
why is setInterval doing a loop?
0 Stemmen
2 Antwoordengoto statement problem!
2 Stemmen
4 AntwoordenCODING CHALLENGE (...or maybe not!)
13 Stemmen
5 AntwoordenLeader
3 Stemmen
1 AntwoordHow to clear canvas (THREE.js)
2 Stemmen
6 AntwoordenWhen 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 Stemmen
4 AntwoordenWhen 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 Stemmen
2 AntwoordenPopulair vandaag
debate which is better
4 Votes
Cource
1 Votes
why is my AI in spanish
0 Votes
Arduino
2 Votes