Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Mathematics ProgramRSS Feeds

PROGRAM TO FIND SUM OF SQUARE UP TO N NUMBERS

Posted By: Oscar Evans     Category: C Programming     Views: 34013

WRITE A PROGRAM TO FIND SUM OF SQUARE UP TO N NUMBERS.

Code for PROGRAM TO FIND SUM OF SQUARE UP TO N NUMBERS in C Programming

#include<stdio.h>
#include<conio.h>

void main()
{
    int n,i,sum = 0;
    clrscr();

    printf("Enter the number::  ");
    scanf("%d",&n);

    for(i=1;i<=n;i++)
        sum += i * i;

    printf("sum  ::  %d",sum);

    getch();
}


/*
**********
OUTPUT
**********

Enter the number:: 3

sum :: 14
*/
  
Share: 


Didn't find what you were looking for? Find more on PROGRAM TO FIND SUM OF SQUARE UP TO N NUMBERS Or get search suggestion and latest updates.

Oscar Evans
Oscar Evans author of PROGRAM TO FIND SUM OF SQUARE UP TO N NUMBERS is from London, United Kingdom.
 
View All Articles

 

Other Interesting Articles in C Programming:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!