Tuesday, September 4, 2018

11. WAP to find out whether a number is even or odd.

#include<stdio.h>
#include<conio.h>
void main()
{
   int num;
   printf("Enter a number: ");
   scanf("%d",&num);
   if(num%2==0)
   {
    printf("\n%d is an even number.",num);
   }
   else
   {
    printf("\n%d is an odd number.",num);
   }
   getch();
}


OUTPUT:



Please have a look at the below video lesson posted on my YouTube channel:



No comments:

Post a Comment