c-thumb

C Program to print Even numbers from 2 to N!

In this post, I am going to write a C program to print ‘even numbers’ from 2 to N. To do that, first I need to get the N value from the user and then iterate using for loop.

To find the ‘even numbers’ I need to divide each value by 2, if the remainder is zero, then it is an ‘even number’. Let’s see the entire C program to print even numbers:

Read the comments in the above program to understand it.

Sample output:

 

Related Posts

Leave a Reply