home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 253_01 / while.c < prev    next >
Encoding:
Text File  |  1990-02-13  |  453 b   |  26 lines

  1.                                          /* Chapter 3 - Program 1 */
  2. /* This is an example of a "while" loop */
  3.  
  4. main()
  5. {
  6. int count;
  7.  
  8.    count = 0;
  9.    while (count < 6) {
  10.       printf("The value of count is %d\n",count);
  11.       count = count + 1;
  12.    }
  13. }
  14.  
  15.  
  16.  
  17. /* Result of execution
  18.  
  19. The value of count is 0
  20. The value of count is 1
  21. The value of count is 2
  22. The value of count is 3
  23. The value of count is 4
  24. The value of count is 5
  25.  
  26. */