On 12/30/2009 1:17 AM, Ahmed Shabana wrote: > You also may use select case operator > > > > On Sat, Dec 26, 2009 at 12:57 PM, Anup Joshi<[email protected]> wrote: > > >> 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 >> ehh.. i am sorry i forgot to mention in the original post, switch-case is also not to be used. i am sorry. :-[
Regards anup
