- // 1^2+2^2+3^2+.......+n^2?
- #include
- int main()
- {
- int i,n,result=0;
- printf("Enter n=");
- scanf("%d",&n);
- for(i=1;i<=n;i++)
- {
- printf("%d",i);
- result=result+i*i;
- }
- printf("\nResult=%d\n",result);
- getch();
- }
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sundaram SubramanianPosted Sep 24, 2017, 12:24 AM