Recent Posts
None | 6 sec ago
ActionScript 3 | 9 sec ago
None | 9 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
None | 3 min ago
HTML | 3 min ago
None | 3 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By nadeeeee on the 9th of Feb 2010 11:32:00 PM
Download |
Raw |
Embed |
Report
#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);
}
Submit a correction or amendment below.
Make A New Post