Largest sphere that can be inscribed inside a cube | Java Program to find the biggest sphere inscribed within a cube ; Function to find the radius of the sphere ; side cannot be negative ; radius of the sphere ; Driver code
class GFG { static float sphere ( float a ) { if ( a < 0 ) return - 1 ; float r = a / 2 ; return r ; } public static void main ( String [ ] args ) { float a = 5 ; System . out . println ( sphere ( a ) ) ; } }