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

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 ODD Integers is %d",sum);
    getch();
}

 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 for Sum of Squares of Numbers from 1 to n
  • C Program for Fibonacci Series Using for Loop
  • C Program to Find Area and Circumference of a circle.
  • Finding GCD and LCM of Given Numbers using C
  • C Program to convert Celsius to Fahrenheit
  • C Program to Compare Two Strings using strcmp()
  • C Program to Sort an Array using SELECTION SORT
  • C Program to Find Given Number is Perfect or Not
  • C Program to Implement Circular Linked List
  • C Program for Implementation of Predictive Parser
  • C Program for Addition of Two Numbers
  • C Program to Implement Call By Value using Functions
  • C Program to Copy Contents From One File to Another
  • C Program for Circumference of a Circle
  • C Program to Implement CONTINUE statement
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top