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 Odd Integers

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

 OUTPUT:

Enter the Number : 10
Sum of all ODD Integers is 25

 

Previous article: C Program to Find Sum of Even Integers Prev Next article: C Program to Find Sum of N Natural Numbers Next
  • C Program to Count Total Number of Digits in a Number
  • C program to find Sum of Digits of a Positive Integer Number
  • C Program to Find Sum of 5 Subjects and Percentage
  • C Program to Find an Element Using Linear Search
  • C Program to Find Second Largest Number in an Array
  • C Program to Find Given Integer is Positive or Negative
  • C Program to Sort List of Strings
  • C Program to Find Radius and Circumference of a Circle
  • C Program for Monthly Bill of a Newspaper
  • Swap Two Static Numbers Using C
  • C Program to find Reverse of a Number
  • C Program for Optimal Page Replacement Algorithm
  • C Program to Find Area of a Triangle
  • C Program to Check Given Number is PRIME or Not
  • Evaluate Algebraic Expression (ax+b)/(ax-b)
  • Privacy Policy
  • Cookie Policy
© programming9.com 2026
Back to top