Program No : 15 :

Write a program in C to display the even or odd numbers between to ranges ?

       program no  :15
purpose : print even or odd  numbers between two ranges.

#include <"stdio.h">

#include<"conio.h">

void main()
{
	int M,N;

	scanf("%d%d",&M,&N);

	 while (M<=N)
	 {
		 if(M%2==0)
		     printf("even   %d\n",M);
		 else
			 printf("odd    %d\n",M); 

		 M++;
	 }

	 getch();
}


Back