c-thumb

C Program to print Odd numbers from 1 to N!

In this post, I am going to write a C program to print ‘Odd numbers’ from 1 to N.

First I need to get the N value from the user and then iterate using for loop.

To find the ‘Odd numbers’ I need to divide each value by 2, if the remainder is not zero, then it is an ‘Odd number’.

Let’s see the entire C program to print odd numbers:

Go through the comments in the above program to understand it.

Sample output of the above program:

Enjoy learning!

 

Related Posts

One thought on “C Program to print Odd numbers from 1 to N!

Leave a Reply