Hello friends,
I wanted to find biggest number of given two numbers without using the
loop statement, the if-conditional, or the ternary operator ?:. One way
i could do this was with the following code:
int biggest(int a, int b) {
int result;
(a<b) && (result = b); // b is bigger
(a>b) && (result =a); // a is bigger
(a==b) && (result = a) // both are equal
return result;
}
this code works for positive as well as negative ints.
i wanted to know if there was any other way to find the biggest number
of the two, by using any other c operator or snippet.
Thanks & Regards :-)
anup