write a program to print all the even numbers from 1 to 20 using for loop
Answers
Answered by
3
Answer:
The program to print even numbers from 1 to 20 can be written using a for loop.
#include <stdio.h>
#include <conio.h>
void main ()
{
int j;
printf(“\n”);
for(n=2; n<=20; n=n+2)
printf(“%d”, n);
getch();
}
Thus, the following output will be shown on the screen:
Similar questions