Adobe Interview Question Development Support Engineers
0of 0 votesfind the maximum of three integers using conditional operator ?
we can use concept
suppose if b>a then below concept can give b as output
c is average of a and b(in between) ;
d---> distance between avg and number(a or b);
c=(a+b)/2;
d=abs(a-b)/2;
so max number will be (c+d)..
a--------c--------b
<---d--->|<--d---->
so max that is b is (c+d);
for three number now get between b and another number using same concept.

(x>y?x:y)>z?(x>y?x:y):z
- fiddler.g on July 24, 2010 Edit | Flag Reply