puzzle in C

Banned
22Sep2009,17:54   #1
vignesh1988i's Avatar
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ЯИ Τ0 С0δЭ ~
22Sep2009,19:15   #2
SaswatPadhi's Avatar
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);}
Banned
23Sep2009,08:13   #3
vignesh1988i's Avatar
ya... you are right..... good keep it up!!!!!!