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

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