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
  • FCFS CPU Scheduling Algorithm Simulation Using C
  • Page Replacement Programs in C
  • Swapping of Two Numbers Using Call By Reference in C
  • C Program for Floyd Triangle
  • C Program to Implement RADIX SORT
  • C Program to find Area of a Circle
  • C Program to Find Given Number is Armstrong or Not
  • C program to find Sum of Digits of a Positive Integer Number
  • C Program to Find Area of Rectangle
  • C Program to Find Factorial of a Number using Recursion
  • C Program to convert Celsius to Fahrenheit
  • C Program to Delete Characters from Given String
  • Implementation of Stack Using Array in C
  • C Program for Matrix Multiplication
  • C Program to Find Number of Characters and Words in a String
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top