Write a program to print even numbers from 1-10 using do while loop in C

//this is a program to print even numbers from 1-10 using do while loop
#include<stdio.h>
#include<conio.h>
void main()
{
int i=1;

printf("\n\nPrinting even numbers form 1-10\n");

do{
if(i%2==0)
{
printf(" %d ",i);
}

i++;
}while(i<10);

getch();

}

Previous
Next Post »