home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c063 / 1.ddi / EXAMPLES.ZIP / INTRO21.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-18  |  278 b   |  14 lines

  1. // INTRO21.CPP--Example from Chapter 3, "An Introduction to C++"
  2.  
  3. #include <iostream.h>
  4.  
  5. int main()
  6. {
  7.     int number, total;
  8.     for (number = 1, total = 0; number < 11; total += number,
  9.     number++);
  10.     cout << "\nTotal of numbers from 1 to 10 is "<< total;
  11.  
  12.    return 0;
  13. }
  14.