Friday, March 25, 2016

Odd Or Even Using Modulus Operator



Implement C program to check odd or even.



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
#include <stdio.h>
 
int main()
{
   int n;
 
   printf("Enter an integer\n");
   scanf("%d", &n);
 
   if (n%2 == 0)
      printf("Even\n");
   else
      printf("Odd\n");
 
   return 0;
}

Share this

0 Comment to " Odd Or Even Using Modulus Operator"

Post a Comment