Wednesday, 10 September 2014

C Language program to find the sum of squares of N natural numbers with Example

This C program will let you know about “find the sum of squares of N natural numbers?”. This C source code is coming under the part of C beginners guide. Feel free to use this code or if you can just contribute as a program writer.
Sum of squares of “n” numbers in c is used to find the square value of a number by using looping statement (for loop). It finds the power value of a given number and adds like wise. It is an easy and efficient way.

//Header files
void main()
    //Program variables
    int j,num,su=0;
    clrscr(); //Function to clear the previous output
    printf("Enter the value:"); //Display function
    scanf("%d",&num); //Getting input function
    for(j=1;j<=num;j++) //Looping statement
    printf("Sum of square = %d",su);

No comments:

Post a comment

Note: only a member of this blog may post a comment.