Program to find the surface area of the square pyramid | Java program to find the surface area Of Square pyramid ; function to find the surface area ; Driver program ; surface area of the square pyramid
import java . io . * ; class GFG { static int surfaceArea ( int b , int s ) { return 2 * b * s + ( int ) Math . pow ( b , 2 ) ; } public static void main ( String [ ] args ) { int b = 3 , s = 4 ; System . out . println ( surfaceArea ( b , s ) ) ; } }