+ 1
How I'll stop my infinite loop in c++ program?
3 Answers
+ 2
Ctrl +c or ctrl+d
Or put a break at first with a condition specified if you don't want the loop to excute infinitely after some time
+ 1
Put a breaking point in ur loop like
int a = 1, flag = 0;
while(a) //Always true
{
cout<<"Abhay is Great \n";
flag += 1;
if(flag>50) // breaking condition
break;
}
+ 1
When u using loop in progrm give proper condition and use break statement else it can run infinite times