+ 6
Need a help to find errors...?
I want help to debug the code my code working infinite times. https://code.sololearn.com/cnyL7hrlgAPD/?ref=app
5 Answers
+ 2
Why you did not code your menu choices outside while loop?Why you did not set a condition for while:
int tries =1;
int count = 0;
While(count < triea){ā¦}
+ 2
While:
Int tries =1;
Ing count =0;
While(count< triea){...}
+ 1
Jayakrishnaš®š³ am not getting
0
Your outer loop has no exit condition..
Add like this
1)
cin >> menuChoice;
if( menu Choice == 'Q')
break;
2)
And instead of
else if (subMenuChoice == 'N' || subMenuChoice == 'n')
{
break;
}
Just add else { break;}
0
Where? Which one not getting?šJasprit š”ļø
Your 1st statement in main
while(true) {..} has no stop condition so it 8s infinite loop... So add a break statement upon a condition like a example i given above..
And in case=>while statements =>if you want to continue, take input 'y' and for any other input use break condition.. Otherwise you have much y or n absolutely so any other input also cause to continue..
So if you want to continue until enter n, then write alternatively if(subMenuChoice =='N' || subMenuChoice =='n') break;