nadeeeee
By: a guest | Feb 9th, 2010 | Syntax:
None | Size: 0.50 KB | Hits: 10 | Expires: Never
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
int squares(int n);
int main()
{
int n, squares;
cout << "Enter an integer larger than 1: " <<endl;
cin >> n;
squares()
cout << "The sum of the squares for " << n << " is " << squares << endl;
//printf("The sum of squares for %d is %d: \n",n,squares(n));
system("Pause");
}
int squares(int n)
{
int sum = 0;
sum = n*n;
if (n != 0)
return (squares(n-1) + sum);
}