Given three distinct numbers A, B and C. Find the number with value in middle (Try to do it with minimum comparisons).
A = 978, B = 518, C = 300
Since 518>300 and 518<978, so
518 is the middle element.
A = 162, B = 934, C = 200
Since 200>162 && 200<934,
So, 200 is the middle element.
You don't need to read input or print anything.Your task is to complete the function middle() which takes three integers A,B and C as input parameters and returns the number which has middle value.
Expected Time Complexity:O(1) Expected Auxillary Space:O(1)