Problem Statement:
Program to check whether the number is even or odd without using arithmetic operators.
Source Code:
#include<stdio.h>
int main(){
int num;
scanf("%d",&num);
if((num&1)==0){
printf("Given number is even");
}else{
printf("Given number is odd");
}
return 0;
}
int main(){
int num;
scanf("%d",&num);
if((num&1)==0){
printf("Given number is even");
}else{
printf("Given number is odd");
}
return 0;
}
SAMPLE INPUT1
8
SAMPLE OUTPUT1
Given number is even
SAMPLE INPUT2
5
SAMPLE OUTPUT2
Given number is odd
8
SAMPLE OUTPUT1
Given number is even
SAMPLE INPUT2
5
SAMPLE OUTPUT2
Given number is odd