Largest rectangle that can be inscribed in a semicircle | Function to find the area of the biggest rectangle ; the radius cannot be negative ; area of the rectangle ; Driver code
< ? php function rectanglearea ( $ r ) { if ( $ r < 0 ) return -1 ; $ a = $ r * $ r ; return $ a ; } $ r = 5 ; echo rectanglearea ( $ r ) . " STRNEWLINE " ; ? >