programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program to Find Sum of Even Integers

Details
Written by: RajaSekhar
Category: C Programs
  • Basic C Programs-2
#include<stdio.h>
#include<conio.h>
void main()
{
    int i,n,sum;
    sum=0;
    clrscr();
    printf("Enter the Number : ");
    scanf("%d",&n);
    for(i=1; i<=n; i++)
    {
        if(i%2==0)
            sum=sum+i;
    }
    printf("Sum of all Even Integers is %d",sum);
    getch();
}

 OUTPUT:

Enter the Number : 10
Sum of all Even Integers is 30
Previous article: C Program to Calculate Sum of Odd Values in an Array Prev Next article: C Program to Find Sum of Odd Integers Next
  • C Program to Calculate NCR
  • C Program to Find Roots of a Quadratic Equation
  • C Program for Monthly Bill of a Newspaper
  • C Program to Find Address locations of Array Elements Using Pointers
  • C Program to Find Largest Element in an Array
  • C Program to Find String Length with out using Function
  • C Program to Find Given Number is Armstrong or Not
  • C Program for Fibonacci Series Using for Loop
  • C Program to Implement Call By Value using Functions
  • C Program to Design Lexical Analyzer
  • C Program to Solve Sum of Series 1-x2/2! +x4/4!-x6/6!+x8/8!-x10/10!
  • C Program to find an Element using Binary Search
  • C Program to Simulate PRIORITY CPU Scheduling Algorithm
  • C Program to Calculate Sum of Even Values in an Array
  • Binary Search Program in C using Recursive and Non-Recursive Methods
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top