Sum of the first 30 squares in C
###### Posted by Samath
Last Updated: December 21, 2014

Write a C program to find the sum of the squares of the integers f rom 1 to 30. Print the sum of the squares.

Solution:

```#include <stdio.h>
using namespace std;
int main(int argc, char *argv[])
{
int i;
int result = 0;

for (i = 1; i <= 30; i++)
{
result = result + (i * i);
}
printf ("%d is the sum of the first 30 squares.\n" ,result);

return 0;
}```

###### Java program that uses a loop to compute the sum of all squares between 1 and 100 (inclusive)
Samath | Apr 03, 2022
###### Sum of two values in C
Samath | Nov 09, 2014
###### C Program to find sum of two numbers
Samath | Jan 02, 2017
###### C++ Calculate the sum from 1 to 100
Samath | Jan 05, 2017
###### Write a C++ program that find the sum of all even numbers between 1 and 30 excluding 6, 8, 24 and 28
Samath | Nov 02, 2014
###### Java program that uses a loop to compute the sum of all odd digits of an input. (For example, if the input is 32677, the sum would be 3 + 7 + 7 = 17.)
Samath | Apr 03, 2022
###### Recursive function that find the sum of digits in a integer using C++
Samath | Dec 24, 2014
###### C Program to calculate sum of 5 subjects, calculate percentage and grade
Samath | Jan 02, 2017
###### C program to find sum of elements of the array
Samath | Jan 02, 2017
###### Java program that prints the sum of the first ten positive integers
Samath | Jan 08, 2021
###### Java program that uses a loop to compute the sum of all even numbers between 2 and 100 (inclusive)
Samath | Apr 03, 2022
###### C program that prompts the user for a positive integer and then computes the sum of all the digits of the number
Samath | May 04, 2016
###### C Program to Compute sum of the array elements using pointers
Samath | Jan 02, 2017
###### Java program that uses a loop to compute the sum of all even numbers between a and b (inclusive), where a and b are inputs
Samath | Apr 03, 2022