/* program 4 * find the sum of the first 'number_to_sum' squares * where number_to_sum is entered at the keyboard */ #include using namespace std; int main() { int sum = 0; // variables int number_to_sum; cout<<"Enter the number of squares to be summed: "; cin >> number_to_sum; for (int i = 1; i <= number_to_sum; i++) sum += (i * i); cout << sum <<" is the sum of the first " << number_to_sum << " squares." << endl; // system("pause"); //un-comment when using DevC++ return 0; }