Program for Area And Perimeter Of Rectangle | Java program to find area and perimeter of rectangle ; Utility function ; Driver Function
import java . io . * ; class Geometry { static int areaRectangle ( int a , int b ) { int area = a * b ; return area ; } static int perimeterRectangle ( int a , int b ) { int perimeter = 2 * ( a + b ) ; return perimeter ; } public static void main ( String [ ] args ) { int a = 5 ; int b = 6 ; System . out . println ( " Area ▁ = ▁ " + areaRectangle ( a , b ) ) ; System . out . println ( " Perimeter ▁ = ▁ " + perimeterRectangle ( a , b ) ) ; } }