puzzle in C

vignesh1988i's Avatar
Banned
PUZZLE IN C!!!!!

write a C/C++ program to say whether a one number is equal to another or not without using RELATIONAL OPERATORS and ARTHMETIC OPERATORS????????
0
SaswatPadhi's Avatar, Join Date: May 2009
~ Б0ЯИ Τ0 С0δЭ ~
That's simple.

A [XOR] B = 0 if A == B
A [XOR] B != 0 if A != B

Code: C
if(A^B) {printf("%d != %d\n",A,B);}
else      {printf("%d == %d\n",A,B);}
0
vignesh1988i's Avatar
Banned
ya... you are right..... good keep it up!!!!!!