Logo 
Search:

C Programming Articles

Submit Article
Home » Articles » C Programming » Data File StructureRSS Feeds

Summation of an even numbers

Posted By: Blas Fischer     Category: C Programming     Views: 4888

Write a program of summation of an even numbers.

Code for Summation of an even numbers in C Programming

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

void main()
{
 int x=0,y=0,n;
 clrscr();
 printf("Enter the value of n : ");
 scanf("%d",&n);
 while(x<=n)
 {
   y+=x;
   x+=2;
 }
 printf("summation of even no up to given no is %d",y);
 getch();
 }
  
Share: 


Didn't find what you were looking for? Find more on Summation of an even numbers Or get search suggestion and latest updates.

Blas Fischer
Blas Fischer author of Summation of an even numbers is from Frankfurt, Germany.
 
View All Articles

Related Articles and Code:


 
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!