While Loop:

while(1); 

Do-While Loop:

do{}while(1);
 
For Loop:

for(;;);
It is recommended to put some delay in each loop. Otherwise task may take up all CPU cycles and may hang up the system.
While Loop:

while(1)
{
  Sleep(1);
}

Do-While Loop:

do
{
  Sleep(1);
}
while(1);
 
For Loop:

for(;;)
{
  Sleep(1);
}

You have viewed 1 page out of 248. Your C learning is 0.00% complete. Login to check your learning progress.

 Vote 0

Similar topics related to this section

loop statements, for, while, do-while loop syntax, for to while, do-while and while usage, infinite loops, break and continue, switch statement, continue in switch and loops,

# C Programming Language (Prentice Hall Software)
# Let Us C Paperback - 2006 by Yashavant Kanetkar
# Understanding and Using C Pointers Core techniques for memory management
# Data Structures Using C and C++ Paperback - 1998
# Data Structures In C Paperback - August 11, 2008 by Noel Kalicharan