Calculate volume and surface area of a cone | Function to calculate Volume of cone ; Function to calculate Surface area of cone ; Driver Code ; Printing value of volume and surface area
< ? php function volume ( $ r , $ h ) { $ pi = 3.14159 ; return ( 1 / 3 ) * $ pi * $ r * $ r * $ h ; } function surface_area ( $ r , $ s ) { $ pi = 3.14159 ; return $ pi * $ r * $ s + $ pi * $ r * $ r ; } $ radius = 5 ; $ slant_height = 13 ; $ height = 12 ; echo ( " Volume ▁ Of ▁ Cone ▁ : ▁ " ) ; echo ( volume ( $ radius , $ height ) ) ; echo ( " STRNEWLINE " ) ; echo ( " Surface ▁ Area ▁ Of ▁ Cone ▁ : ▁ " ) ; echo ( surface_area ( $ radius , $ slant_height ) ) ; ? >