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...
Learn a little bit about the new Pastebin.com on our help page. hide message
By nadeeeee on the 9th of Feb 2010 11:32:00 PM Download | Raw | Embed | Report
  1.  
  2. #include <iostream>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5.  
  6. using namespace std;
  7.  
  8. int squares(int n);
  9. int main()
  10. {
  11.         int n, squares;
  12.         cout << "Enter an integer larger than 1: " <<endl;
  13.   cin >> n;
  14.  
  15.   squares()
  16.  
  17.   cout << "The sum of the squares for " << n << " is " << squares << endl;
  18.  
  19.   //printf("The sum of squares for %d is %d: \n",n,squares(n));
  20.  
  21. system("Pause");
  22. }
  23.  
  24. int squares(int n)
  25. {
  26.         int sum = 0;
  27.         sum = n*n;
  28.         if (n != 0)
  29.                 return (squares(n-1) + sum);
  30.  
  31.  
  32.  
  33. }
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: