text: Largest right circular cylinder within a frustum | Function to find the biggest right circular cylinder ; radii and height cannot be negative ; radius of right circular cylinder ; height of right circular cylinder ; volume of right circular cylinder ; Driver code
code: < ? php function cyl ( $ r , $ R , $ h ) { if ( $ h < 0 && $ r < 0 && $ R < 0 ) return -1 ; $ r1 = $ r ; $ h1 = $ h ; $ V = ( 3.14 * pow ( $ r1 , 2 ) * $ h1 ) ; return $ V ; } $ r = 7 ; $ R = 11 ; $ h = 6 ; echo cyl ( $ r , $ R , $ h ) ;