home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / ctutor2.zip / WHILE.C < prev    next >
Text File  |  1989-11-10  |  453b  |  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. */