Programs in C

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;
}
Posted by Unknown at 09:33
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ▼  2015 (16)
    • ▼  August (16)
      • Program to find roots of quadratic equation using ...
      • To perform Arithmetic Operations Using Switch case
      • To find fibonacci series
      • To find factorial of number
      • To find Sum of square program
      • To find the sum and average of n elements given by...
      • To Check Whether a Number is Positive or Negative
      • To check given number is even or odd
      • To find Largest of Two Numbers using Conditional O...
      • Find greatest of 3 number using conditional operator
      • To find greatest number from two numbers using if ...
      • To find the largest of three numbers using if else
      • To Check given number is Prime Number or Not
      • Print prime number from 0 to n number
      • Convert Celsius to Fahrenheit
      • Convert Fahrenheit to Celsius

Popular Posts

Simple theme. Powered by Blogger.