Search This Blog


Tuesday, 9 April 2019

Program to PRINT ALL EVEN NUMBER UNDER 100 in C Language

 PRINT ALL EVEN NUMBER UNDER 100

Hey people of Code Junction,Welcome Back to this blog so lets print all even numbers till 100.
Its an easy program.


Write a C program to print all even numbers from 1 to n using for loop. C program to generate all even numbers between given range. Logic to print even numbers using if else and for loop in given range in C programming.
Lets dive into it right now !!

CODE

#include<stdio.h>
int main()
{
int i;                                      //Variable Declaration

for(i=2;i<=100;i=i+2)         //loop starts with 2 till 100,and after 1 loop i will starts with addition of 2
{                                               
printf("\n %d",i);
}
return 0;
}


No comments:

Post a Comment