home *** CD-ROM | disk | FTP | other *** search
/ The Devil's Doorknob BBS Capture (1996-2003) / devilsdoorknobbbscapture1996-2003.iso / Dloads / OTHERUTI / TCPP30-3.ZIP / EXAMPLES.ZIP / INTRO22.CPP < prev    next >
C/C++ Source or Header  |  1992-02-18  |  285b  |  17 lines

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