The outcome of XOR operation is true only when one of the operand is true(but not both).
P Q P^Q
---------------------------------------------
1 1 0
0 0 0
1 0 1
0 1 1
int xor(int a, int b)
{
return (a||b) && !(a && b);
}
Tuesday, May 25, 2010
Subscribe to:
Post Comments (Atom)
Thanks for every other magnificent article. Where else may just anyone get
ReplyDeletethat kind of info in such a perfect method of writing?
I've a presentation next week, and I am at the search for such info.
Check out my blog post nytimes626.com