//                 In-Class Assignment 5
//                Count-controlled loops
//
// 1. Save a copy of this program on your disk. Then open the
//    program in your C++ program editor.
//
// 2. This program calculates and prints the sum of the integers
//    from 1 to 10. Run the program to verify this.
//
// 3. Modify the program to calculate and print the sum of the
//    integers from 1 to 20. Run your program to verify that it
//    works correctly. Turn in a listing of your program. Be
//    sure your name is on it.
//
// 4. Optional: Try to modify your program so that it calculates
//    and prints the sum of the even numbers between 1 and 21.
//
//***********************************************************
// Program   : Summing Integers
// Programmer: Your Name
//
// This program calculates and prints the sum of the integers
// from 1 to 10.
//***********************************************************

#include <iostream.h>

int main()
{
   int num;   // loop counter
   int sum;   // sum of the input integers

// Sum the list
   sum = 0;

   num = 1;
   while (num <= 10)
   {
      sum = sum + num;
      num = num + 1;
   }

// Print the sum
   cout << "The sum of the numbers is " << sum << endl;

   return 0;
}


