It is often prudent to test around the edges.
int cmp1(int a, int b)
return a == b ? 0 : a < b ? -1 : 1;
int cmp2(int x, int y)
if ( x - y + abs(x-y) ) … Read More
This is Neigyl...
I'm still a newbie here...
I hope this'll help...
int main ()
int a = 11, b = 10;
/* We didn't use a relational operator here but the definition
of max() and min() in stdlib.h uses so. */
printf ("The greater value is %d", max(a, b));
printf ("\nThe lesser value is %d", min(a, b));
/* We didn't use a relational operator here in a sense that such
operator didn't appear inside the if. */
if (a - b + abs(a - b))
printf ("a is greater than b.");
printf ("a is lesser or equal than b.");
a = b = 5;
if (a - b)
printf ("They are not equal.");
printf ("They are equal.");
/* With the 2 scenarios above, we never used the relational operator in our program. */