How to make an infinite loop and a time delay loop using for loop?

An infinite loop can be made by for loop by not entering any conditional expression.

For Example:

for( ; ; )

printf(“Infinite Loop.\n”);

But, to make sure that this infinite loop goes on and on there must not be any break; statement in the rest of the program. If there is a break statement then the infinite loop will be terminated and the normal execution of the program will begin.

A time delay loop can also be created by the use of for loop:

for(t=0; t<60; t++) ;

Leave a Reply