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 Example for Call By Reference
  • C Program for Fibonacci Series Using for Loop
  • C Program for Implementation of Predictive Parser
  • C Program to Convert Infix to Postfix Expression using Stack
  • C Program to Convert Temperature from Degree Centigrade to Fahrenheit
  • C Program to find Reverse of a Number
  • C Program to Implement SJF CPU Scheduling Algorithm
  • C Program to Find String Length with out using Function
  • C Program to Calculate Sum of Odd Values in an Array
  • C Program for Finding Factorial of a Number
  • C Program to Find Sum of 5 Subjects and Percentage
  • C Program for Sum of Squares of Numbers from 1 to n
  • C Program to Swap Two Numbers without using Third Variable
  • C Program for Floyd Triangle
  • C Program for String Comparison without using Built in Function
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top