#include<stdio.h>
int main()
{
{
int n,j;
int s=0;
printf("Enter
the value of n");
scanf("%d",&n);
s
= (n*(n+1)*(2*n+1))/6;
printf("Sum of
the series is : ");
for(j
=1;j<=n;j++)
{
if (j!= n)
printf("%d^2 +
",j);
else
printf("%d^2 =
%d ",j,sum);
}
return 0;
}
0 Comments