Breaking the infinite loop

Viewed 47

I have a question which is how can we break an infinite loop without using break statement?

int main(){
     while(true){
         switch(1){
             case 1: cout<<"Infinte loop"<<endl;
             break;
         }
     //We cannot use the break statement inside the while loop
     //Please share the answer on how can we break the infinite loop without using break 
       //statement inside the loop, we can use break; inside switch but not inside while

     }
}
0 Answers
Related