Adobe Interview Question
Development Support Engineerswe 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>z ? x : z : y > z ? y : z
- Anonymous September 27, 2010