for example

#include<stdio.h>
int main() 
{ 
    int i=0; 
      
    for (i = 1; i <= 10; i++) 
    { 
        printf( "Hello World\n");     
    } 
  
    return 0; 
} 

output

Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World
Hello World




while example

#include<stdio.h>
int main() 
{ 
    
    int j = 1;    /* initialization expression   */
  
    while (j < 6)       /* test expression */
    { 
        printf( "Hello World\n");     
        j++;     /* update expression */
    } 
  
    return 0; 
} 

output

Hello World
Hello World
Hello World
Hello World
Hello World




do while example

#include<stdio.h>
int main() 
{ 
    int k = 2;      // Initialization expression 
  
    do
    { 
        // loop body 
        printf( "Hello World\n");     
  
        // update expression 
        k++; 
  
    }  while (k < 1);   // test expression 
  
    return 0; 
} 

output

Hello World




infinite loop example

#include<stdio.h>
int main () 
{ 
    int l; 
  
    /* This is an infinite for loop as the condition expression is blank   */
    for ( ; ; ) 
    { 
       printf("This loop will run forever.\n"); 
    } 
  
    /* This is an infinite for loop as the condition given in while loop will keep repeating infinitely  */
    /* 
    while (l != 0) 
    { 
        i-- ; 
        printf( "This loop will run forever.\n"); 
    } 
    */
  
    /* This is an infinite for loop as the condition given in while loop is "true" */
    /* 
    while (true) 
    { 
        printf( "This loop will run forever.\n"); 
    } 
    */
} 

output

This loop will run forever.
This loop will run forever.
...................