## INDEX

### Write a c program to find out the sum of series 1^2 + 2^2 + …. + n^2.

Sum of 1^2 + 2^2 + …. + n^2 series in c programming language

#include<stdio.h>

int main(){

int n,i;
int sum=0;

printf("Enter the n i.e. max values of series: ");
scanf("%d",&n);

sum = (n * (n + 1) * (2 * n + 1 )) / 6;

printf("Sum of the series : ");

for(i =1;i<=n;i++){
if (i != n)
printf("%d^2 + ",i);
else
printf("%d^2 = %d ",i,sum);
}

return 0;
}

Sample output:

Enter the n i.e. max values of series: 5
Sum of the series: 1^2 + 2^2 + 3^2 + 4^2 + 5^2 = 55

Mathematical Formula:

Sum of the series 12 + 22 + 32 + … + n2 =
n (n+1) (2n+1)/6

6. Write a c program to find out the sum of given H.P.

preeree said...

thanks...............

Anonymous said...

Help me
Write a C or Java program to find out the sum of series:
1! + 2! + 3! + . . . + N, with N input from keyboard

Md Faiyaz Ansari said...

thank you :)

Anonymous said...

1/x+1/x^2+1/x^3+.....

Ah Lop said...

Very good..

Vibon Keat said...

Dear sir, Can you have me to write total sum of 2^2+10^2+20^2+50^2+100^2 in java??

mohsinahmed alif said...

1^2+3^2+5^2....................nth find out sum use for loop in c

mohsinahmed alif said...

plz........ any one help me.........

monir hossain said...

#include
int main()
{
int n,sum=0,i;
scanf("%d",&n);
for(i=0;i<=n;i++)
{
sum=(sum+i*i);
}
printf("%d",sum);
return 0;
}

eng porag said...

please solutionthis program in C++ to generate the series as 1, 3, 4, 8, 15, 27, 50, ........

eng porag said...

please solution this program in C++ to generate the series as 1, 3, 4, 8, 15, 27, 50, ........

Solaiman Shohag said...

#include
int main()
{
int n,sum=0,i;
scanf("%d",&n);
for(i=1;i<=n;i=i+2)
{
sum=(sum+i*i);
}
printf("%d",sum);
return 0;
}

Tapos Bormon said...

1^2+2^4+3^6+4^8+.............+n^2n for loop c programming code please ans me

Abhra Mitra,1997 said...
This comment has been removed by the author.
Abhra Mitra,1997 said...

your program didn't work. I did a little modification and now it works..

#include
int main()
{
int n,sum=1,i, j=0;
scanf("%d",&n);
for(i=1;i<=n; i++)
{
sum=(sum+(j*j));
j=j+2;
}
printf("%d",sum);
return 0;
}

Cynthia Zemp said...
This comment has been removed by the author.
jonatha ivan sanchez martinez said...

1^2+2^2+n^2 /n^2 en c++ como quedaría me dijeron que fuera dando los pasos

jonatha ivan sanchez martinez said...

que libreria metiste para que funcionara el programa

Tewfiqur Rahman said...

2^2+4^4+......n^n

Avi Singh said...

can u help me to write a program in c to print the series
2, 6, 11, 10, 15, 21, 18, 24, 31, 26, 33, 41 .....answer me as much as possibel

Aashish Dhital said...

Write flowchart and program to read value for x and print the series 3*x^2, 5*x^2, 7*x^2.... 25th terms

Manish Joshi said...

plz write the c code

2,6,15,28,55,78

1*2=2
2*3=6
3*5=15
4*7=28
5*11=55
6*13=78.

Plx sir
How can i solve the pyramid through this coding plx i want help its my assignment...
Like
0
101
21012
3210123
432101234
54321012345
Exactly like this