Wednesday, May 16, 2018

C program to display all even numbers between one and ten.


Program code
#include <stdio.h>
#include <conio.h>
void main()
{
int i;
clrscr();
printf(“The even numbers between one and 10\n”);
for (i=2;i<=10;i=i+2)
printf(“%d\n”,i);
getch();
}

Output
The even numbers between one and 10
2
4
6
8
10

No comments:

Post a Comment

Please write here, your opinion about this C program