Member • Sep 19, 2013
c program to check no. is even or odd without using conditional operator !!
#include// in above c code using % operator and array we can find the no. is even or odd also we can perform it by using bitwise AND operato (&) and AND operator (&&).................#include int main() { int no; char ch[0]="Even"; char ch[1]="odd"; printf("Enter a no. \t"); scanf("%d",&no); printf("\n The no. is %s",ch[no%2]); return (0); }
I gave u the hint can anybody is able to write 2nd program ...😉😀//
o/p--> Enter a no. 7
The no. is odd
Enter a no. 4
The no. is Even