Hello Friends. I am not able to solve a question in C If u have any idea pls help me The Question is program to find smallest of three numbers without using comparsion operator Thanks
Hello do something like this a,b,c d = a-b; get MSB of d if(MSB) no is +ve and a>b and so compare a and c else no is -ve and a<b so compare b and c in similar fashion. Thanks Shabbir Bhimani
Code: a,b,c d = a-b; get MSB of d if(MSB) no is +ve and a>b and so compare a and c //Number d is positive and so we get a as greater than b //Now compare a and c in similar fashion else no is -ve and a<b so compare b and c in similar fashion. //Number d is negative and so we get a as less than b //Now compare b and c in similar fashion I hope this comments as explanation helps you to understand. Thanks Shabbir Bhimani