#include int main() { // PRE: The user enters an integer >= 0 // POST: Shows the sum of the first n integers int j, n; int sum = 0; cout << "Enter n: "; cin >> n; for(j = 1; j <= n; j++) { sum = sum + j; } cout << "The sum of the first " << n << " integers is " << sum << endl; cout << "With Gauss's formula, the sum is " << (n*(n+1))/2 << endl; return 0; }