C Program to Find Sum of the Series

 C Program to Find Sum of the Series
(1) + (1+2) + (1+2+3) + (1+2+3+4) + ... + (1+2+3+4+...+n)

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

}
Copyright © C Program | Java | OpenGL Programming | Hadoop at Computaholics