Monday, 17 August 2015

To find Sum of square program

/*c program for accept number and calculate sum of square*/
#include<stdio.h>
int main()
{
 int num,sum=0,i;
 printf("Enter any number : ");
 scanf("%d"&num);
 for(i=1; i<=num; i++)
    sum = sum + (i*i);
 printf("Sum of square of %d = %d",num,sum);
 return 0;
}

No comments:

Post a Comment