Infinte Loop is the loop where loop continously run, and chances of condition become false is 0.
Infinte loop in for loop:
for(i=0;i>=0;i++)
{
}
-In this, value of i is always greator then 0 so loop continue run.
Infinite Loop in while loop:
while(1)
{
}
-In this, while(1) refers as always true
program-
#include< stdio.h>
int main()
{
while(1)
{
printf("Inside Loop\n");
}
}
Inside Loop
Inside Loop
Inside Loop
Inside Loop
Inside Loop
.
.
.
.
.
.