home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c021 / 7.img / EXAMPLES.ZIP / INTRO18.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-04  |  277 b   |  14 lines

  1. /* INTRO18.C--Example from Chapter 4 of Getting Started */
  2.  
  3. #include <stdio.h>
  4.  
  5. int main()
  6. {
  7.    int number, total;
  8.    for (number = 1, total = 0; number < 11; total += number,
  9.     number++);
  10.    printf("Total of numbers from 1 to 10 is %d\n", total);
  11.  
  12.    return 0;
  13. }
  14.