I am suffering from the problem please anyone help me
I have the following condition
j=0;
while(j<9){
for(i=0;i<10;i++){
//statements
if(condition){
//statements
}
}
for(k=0;k<10;k++){
//statements
if(condition){
//statements}
}
}
j++;
}
Now my Question is that i need a condition in both "if" that terminate the while loop but not exit the program
Chances are that the loop is better off in its own function. You can then use return.
bool valid = true;
j=0;
while(j<9){
for(i=0;i<10;i++){
//statements
if( valid = condition){
//statements
}
}
for(k=0;valid && k<10;k++){
//statements
if( valid = condition){
//statements}
}
}
if ( !valid ) break;
j++;
}