// RawSum.cpp // tom bailey 22 jan 07 // Request n. // Print the sum of the integers from 1 to n. #include using std::cout; using std::cin; using std::endl; int main() { cout << "Enter last integer in sum: "; int n( 0 ); cin >> n; int sum( 0 ); for( int i=1; i<=n; ++i ) { sum += i; } cout << sum << endl; return 0; }