Largest sphere that can be inscribed inside a cube | Function to find the radius of the sphere ; side cannot be negative ; radius of the sphere ; Driver code
function sphere ( a ) { if ( a < 0 ) return - 1 ; var r = a / 2 ; return r ; } var a = 5 ; document . write ( sphere ( a ) ) ;