C program to display odd numbers between 1 and 100

Program to display (print) the odd numbers between 1 and 100

Odd number can not be divided by 2. The remainder after dividing an Odd number by 2 is one. For example . . . Odd numbers between 1 and 5 are 1,3,5. The below given C program is used to display (print) the odd numbers present in between 1 and 100. Kindly check out to display the odd numbers present in between 1 and 100.


Program to display (print) the odd numbers


#include<stdio.h> 

int main(){

               int rem,i;

               printf("\n The odd numbers between 1 and 100 are \n"); 

               for(i=1; i<=100; ++i){

               rem = i % 2;

               if(rem != 0)

               printf("\n  %d",i);

               }

    return 0; 

    } 

 


Sample outputs:


  The odd numbers between 1 and 100 are

   1

   3

   5

   7

   9

 . . . . 


  • Questions and answers
  • Download Pdf
  • Answers
  • Interviews
  • Solved
  • And College
  • Antivirus Program


Most Related Even or Odd Programs in C


* C program to check even or odd using Bitwise Operator

* C program to find Sum of Odd Digits of a Number

C program to find Sum of Even Digits of a Number

* C program to find Sum of Even and Odd Digits of a Number

* C program to print Odd Digits of a Number

* C program to print Even Digits of a Number

* C program to display Odd numbers from the given N numbers

* C program to display Even numbers from the given N numbers

* C program to check whether a number is odd or even

* C program to check odd or even using if else
* C program to check odd or even using switch case
* C program to check odd or even using function
* C program to check odd or even using Ternary Operator

Bookmark and Share