home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / ctutor2.zip / FORLOOP.C < prev    next >
Text File  |  1989-11-10  |  455b  |  24 lines

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