C++ program computing sum of squares of two
[Closed]
Report
kajinti

don 
don 
Related:
 C++ program to find sum of squares of numbers
 C++ program to find sum of squares of digits of a number  Best answers
 Program to find sum of two numbers in c++  Best answers
 C program to find sum of series 1+11+111 ✓  Forum  Programming
 How To Find Square Root in C Program  HowTo  Programming
 Square brackets mac  HowTo  MacOS
 Program to draw a human face in c graphics  HowTo  Programming
 Write a unix system program to read a file in reverse  HowTo  Shell
1 reply
don
#include <iostream>
using namespace std;
int main()
{
int i,sum; // variables
sum = 0; // initialize sum
/* recursive addition of squares */
for (i = 1; I <= 30; i++)
sum = sum + (i * i);
cout << sum <<" is the sum of the first 30 squares."
<< endl;
return 0;
}
.........................................
using namespace std;
int main()
{
int i,sum; // variables
sum = 0; // initialize sum
/* recursive addition of squares */
for (i = 1; I <= 30; i++)
sum = sum + (i * i);
cout << sum <<" is the sum of the first 30 squares."
<< endl;
return 0;
}
.........................................