Computer Science, asked by pv057966, 8 months ago

write a program to print area and perimeter of a square in java​

Answers

Answered by paarthhans2006
26

/* Java Program Example - Calculate Area Perimeter of Square */

 

import java.util.Scanner;

public class JavaProgram

{

   public static void main(String args[])

   {

       int side, peri, area;

       Scanner scan = new Scanner(System.in);

 

       System.out.print("Enter Side Length of Square : ");

       side = scan.nextInt();

 

       area = side*side;

       peri = 4*side;

 

       System.out.print("Area = " +area);

 

       System.out.print("\nPerimeter = " +peri);

   }

}

please MARK AS BRAINLIEST

Similar questions