Tuesday, March 5, 2024

8. 1²+2²+3²+4²+...+10² :—

8. 1²+2²+3²+4²+...+10² :—


#include<stdio.h>

int main()

{

    int i,sum;

    sum=0;

    for(i=1;i<=10;i++)

    {

        sum=sum+i*i;

    }

    printf("%d",sum);

    return 0;

}


No comments:

Post a Comment