**C Program to print odd numbers till N:** To print the odd numbers till N.

**Odd Number:** Any number which is divided by two and gives the remainder as 1 then that Number is referred to an odd number such as 1, 3, 5, 7, ….

## Algorithm to print odd numbers

- Take input. N
- Traverse from 0 to N
- Calculate rem = i % 2

If rem == 1

Print odd Number

else

Continue

## C Program to print odd numbers till N

#include<stdio.h> void main() { int no , i ; printf("Enter a Number\n"); scanf("%d", &no); // take input from user the n printf( "\nodd numbers till %d:\n",no); // Iterate till no for(i=0;i<=no;i++) { //Condition to check odd number if(i % 2 == 1) printf("%d\n",i); //print odd number else continue; // otherwise skip } printf("\n"); }

**Output :**