biggest of two nos without using relational operator

Posted by ratty on Stack Overflow See other posts from Stack Overflow or by ratty
Published on 2010-04-09T10:50:09Z Indexed on 2010/04/09 10:53 UTC
Read the original article Hit count: 258

Filed under:
|

i like to find the greatest of two nos without using < > this relational operator. i tired this

int a,b;
if(a/b==0)
{
b is greater
}
else
{
a is greater
}

but this not working for negative nos .please help for this

© Stack Overflow or respective owner

Related posts about c

    Related posts about comparison