sum of series

sum of series  (1*1) + (2*2) + (3*3) + (4*4) + (5*5) + ... + (n*n)


#include<stdio.h>
int main()
{
    int j,n,sum=0;
    n=10;
    for(j=1;j<=n;j++)
    {
        sum+=j*j;
    }
    printf("Sum is: %d",sum);
}

Related Posts