Posted by: Dilbar June 28, 2010
could anyone help with this problem please
Login in to Rate this Post:     0       ?        
could anyone help with this problem please

You are given three integer numbers: ab and c. Write a function:

int median3(int a,int b,int c);

which returns the second largest number x, among sequence (a,b,c).

For example:

  • for median3(4, 2, 6) the correct answer is 4,
  • for median3(1, 2, 2) the correct answer is 2.
Read Full Discussion Thread for this article