using c for this code IV Code Fragment Write the statements necessary to code th
ID: 644808 • Letter: U
Question
using c for this code
Explanation / Answer
it give only sum of the squres
--------------------------------------------
#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,sum=0;
clrscr();
printf("Enter Value of N (terms) : ");
scanf("%d",&n);
printf(" ");
for(i=1;i<=n;i++)
{
printf("%4d",i*i);
sum+=i*i;
}
printf(" Sum of Square Natural Number upto %d terms = %d ",n,sum);
getch();
}
it gives squares and their sum.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.