Code
#include <iostream>
using namespace std;
int squaresum(int n) ;
int main()
{
int n;
cout<<"Enter a positive integer : ";cin>>n;
cout << squaresum(n) << endl;
return 0;
}
int squaresum(int n)
{
int sum = 0;
for (int i = 1; i <= n; i++)
sum += (i * i);
return sum;
}
OUTPUT
Subscribe to:
Post Comments (Atom)
C++ BLACKJACK
#include <iostream> #include <ctime> #include <stdlib.h> #include <time.h> #include <string> using namesp...
-
Code #include <iostream> using namespace std; void prime_factor(int n); int main() { int n; cout<<"Enter a numbe...
-
Code #include <iostream> using namespace std; int main() { int i,j,r; cout << " Input number of rows : "; ...
-
Code #include <iostream> using namespace std; int main(){ int i=2, j, is_prime; // we set i = 2 because prime numbers start a...
Sömbät – kirill - Kohli Kondrashin
ReplyDeleteThe kirill is the most famous and famous of 카지노 the two popular kirill-kondrashin cultures around the world. In fact, it is the oldest known of all of the animals that holds the