use 26 to check even and odd in c

Solutions on MaxInterview for use 26 to check even and odd in c by the best coders in the world

showing results for - "use 26 to check even and odd in c"
Charlotte
10 Oct 2018
1/* Program to check if number is even or odd
2 * using bitwise operator
3 */
4#include<stdio.h>
5 
6int main()
7{
8   int n;
9 
10   printf("Enter an integer: ");
11   scanf("%d",&n);
12 
13   if ( n & 1)
14      printf("%d is an odd number", n);
15   else
16      printf("%d is an even number", n);
17 
18   return 0;
19}
similar questions
queries leading to this page
use 26 to check even and odd in c