Program for Volume and Surface area of Frustum of Cone | Function to calculate Volume of frustum of cone ; Function to calculate Curved Surface area of frustum of cone ; Function to calculate Total Surface area of frustum of cone ; Driver Code ; Printing value of volume and surface area
< ? php function volume ( $ r , $ R , $ h ) { $ pi = 3.14159 ; return ( 1 / ( 3 ) ) * $ pi * $ h * ( $ r * $ r + $ R * $ R + $ r * $ R ) ; } function curved_surface_area ( $ r , $ R , $ l ) { $ pi = 3.14159 ; return $ pi * $ l * ( $ R + $ r ) ; } function total_surface_area ( $ r , $ R , $ l , $ h ) { $ pi = 3.14159 ; return ( $ pi * $ l * ( $ R + $ r ) + $ pi * ( $ r * $ r + $ R * $ R ) ) ; } $ small_radius = 3 ; $ big_radius = 8 ; $ slant_height = 13 ; $ height = 12 ; echo ( " Volume ▁ Of ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; echo ( volume ( $ small_radius , $ big_radius , $ height ) ) ; echo ( " STRNEWLINE " ) ; echo ( " Curved ▁ Surface ▁ Area ▁ Of ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; echo ( curved_surface_area ( $ small_radius , $ big_radius , $ slant_height ) ) ; echo ( " STRNEWLINE " ) ; echo ( " Total ▁ Surface ▁ Area ▁ Of ▁ Frustum ▁ of ▁ Cone ▁ : ▁ " ) ; echo ( total_surface_area ( $ small_radius , $ big_radius , $ slant_height , $ height ) ) ; ? >