Page 58 - 6437
P. 58

Here,  the  key  point  to  note  is  that  a  while  loop  might  not  execute  at  all.  When  the
                   condition is tested and the result is false, the loop body will be skipped and the first statement
                   after the while loop will be executed.

                          Example

                 #include <stdio.h>


                 int main ()

                 {
                    /* local variable definition */

                    int a = 10;


                    /* while loop execution */
                    while( a < 20 )

                    {
                        printf("value of a: %d\n", a);

                        a++;
                    }










                                                                                                      60
   53   54   55   56   57   58   59   60   61   62   63