C Program to Print Even Number From 1 to n

Printing even numbers from 1 to n is a beginner-level programming task in which we have to print all even numbers in the given range, Let’s write a C program to print even numbers from 1 to n.

Even Number From 1 to n

Table of Contents

Objective

The objective is clear we have to write a C program that generates and prints even numbers within the specified range of 1 to n.

The logic of printing even numbers from 1 to n is simple forward we will use a loop to iterate from 1 to n. In each iteration, we will check if the number is even or not, if the number is even then we will display it otherwise we will proceed to the other number.

C Program

Output

In this tutorial we use a simple C program that prints all even numbers in the specified range, We can use the same logic in other programming languages like C++, JAVA Python, etc.

See Also

2 thoughts on “C Program to Print Even Number From 1 to n”

Leave a Comment