#include<iostream>
using namespace std;


int main ()
{
  // initialize input variables and counting variable
  int num1, num2, min, max, count;
  // initialize sum variable between min and max numbers
  int sum = 0;


  // take inputs from user
  cout << "Provide two numbers: ";
  cin >> num1 >> num2;


  // determine which of inputs is larger and assign the
  // two inputs as min and max
  if (num1 < num2) {
     min = num1;   max = num2;
  }
  else {
     min = num2;   max = num1;
  }


  // begin count at minimum value
  count = min;


  // perform summation
  while ( count <= max ) {
     sum += count;
     count++;
  }


  // Output result of sum
  cout << "Sum of numbers between " << min << " and "
       << max << " is " << sum << endl;


  return 0;
}