// compute the sum of the first n integer numbers #include using std::cout; using std::cin; using std::endl; // function main int main() { int sum = 0; int nmax; int number = 1; cout << " This program computes the sum of the first n integers: enter n "; cin >> nmax; while (number <= nmax) { sum += number; number++; } //end while cout << " The sum of the first " << nmax << " integers is " << sum << endl; return 0; // successful termination } // end main