Tuesday, 16 June 2015

C program to find a number is even or odd.

To find that given number is even or odd.

Program:

#include <stdio.h>
#include <conio.h>
int main()
 {
      int num;   //Declaring Variable.
   
   printf("Enter an integer you want to check: ");//For printing
      scanf("%d",&num);
     
      if((num%2)==0)      /* Checking whether remainder is 0 or not. */
        printf("%d is even.",num);   //For printing
      else
     printf("%d is odd.",num);   //For printing
      
  getch();   //Getting a chracter or waiting for key press.
  return 0;
}
Output:



Video Explanation
Sorry Guys Explanation of this tutorial will be posted later this month.

No comments:

Post a Comment