Nest for loop inside do while loop : Do While « Statement « C Tutorial






#include <stdio.h>

int main()
{
    int start = 10;
    long delay = 1000;
 
 
    do
    {
        printf(" %d\n",start);
        start--;
        for(delay=0;delay<100000;delay++);   /* delay loop */
    }
    while(start>0);
 
    printf("Zero!\nBlast off!\n");
    return(0);
}
10
       9
       8
       7
       6
       5
       4
       3
       2
       1
      Zero!
      Blast off!








6.8.Do While
6.8.1.The do...while loop
6.8.2.Reversing the digits: do while loop
6.8.3.Read number in a range
6.8.4.Nest for loop inside do while loop