Sum of Series||C language||programming_info ||Series problem 6

C Program to calculate 
(1*1)+(2*2)+(3*3)+.....(n*n)

Solution using C language:
#include<stdio.h>
#include<conio.h>

void main()
{
int i,n,sum=0;
 clrscr();
n=10;
    for(i=1;i<=n;i++)
    {
        sum+=i*i;
    }
    printf("Sum: %d",sum);
getch();
}
Output:
sum:385
Share:

No comments:

Post a Comment

Translate

Recommended platforms

  1. codechef
  2. hackerrank
  3. codeforces
  4. leetcode
  5. hackerearth

Popular Posts

programming_info. Powered by Blogger.

Blog Archive

Recent Posts

other platforms

  • geeks for geeks
  • w3schools
  • codepen
  • skillshare
  • udemy

Pages

reader support Support