// Justin C. Miller
// University of Wisconsin Oshkosh
// Made for: http://www.geocities.com/neonprimetime.geo/index.html
// Date: 2001
// Borland Builder 4.0
// input x and y, then add up the sum of numbers x to y or y to x
#include
void swap ( int &num1 , int &num2 ) ;
int main()
{
int sum = 0 ;
int x = 0 ;
int y = 0 ;
cout << "Please enter a range, this program" << endl ;
cout << "Will sum up the numbers inbetween your range" << endl ;
cout << "Enter number1" << endl ;
cin >> x ;
cout << "Enter number2" << endl ;
cin >> y ;
if ( y < x )
{
swap ( x , y ) ;
}
for ( x ; x <= y ; ++ x )
{
sum += x ;
}
cout << sum << endl ;
return 0 ;
}
void swap ( int &num1 , int &num2 )
{
int temp = num1 ;
num1 = num2 ;
num2 = temp ;
return ;
}
               (
geocities.com/neonprimetime.geo/cpp)                   (
geocities.com/neonprimetime.geo)