| |
Program to find sum of squares till a given number
/*Sum of squares till a given number*/
include<stdio.h>
main()
{
int n,i=1,sum=0;
clrscr();
printf("\nEnter a number ");
scanf("%d",&n);
while(i<=n)
{
sum=sum+i*i;
i++;
}
printf("\nSum of sqaures is %d",sum);
getch();
}
Please send comments to vgdarur.javafive@blogger.com
|