Trouble returning the middle of the three numbers

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 2619 Views - Last Post: 10 March 2012 - 08:18 PM Rate Topic: -----

#16 ola3  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 21
  • Joined: 17-February 12

Re: Trouble returning the middle of the three numbers

Posted 10 March 2012 - 08:07 PM

I'm just trying to understand the logic behind that bit of code

View Postpbl, on 10 March 2012 - 06:48 PM, said:

Same homework ?
All solved there

http://www.dreaminco...8&#entry1572438

Was This Post Helpful? 0
  • +
  • -

#17 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8324
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Trouble returning the middle of the three numbers

Posted 10 March 2012 - 08:18 PM

View PostSwiftStriker00, on 02 March 2012 - 10:09 AM, said:

or you can make your prof cry by trying to read this

public static int median(int x, int y, int z){
  return ( x > y ) ? ( x > z) ? z : x : ( y > z ) ? z : y ;
}


I would fire you if you wrote code like this in my shop, but desserves a +1 anyhow :)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2