write a program to print area and perimeter of a square in java
Answers
Answered by
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
Hindi,
4 months ago
Math,
8 months ago
Science,
8 months ago
Chemistry,
11 months ago
Business Studies,
11 months ago