write a program in Java to find area and perimeter of a square. given the side of square is 5cm
Answers
Answered by
1
Explanation:
Program: calculate area & perimeter of a square in java
1). import java.util.Scanner;
2). public class AreaAndPerimeterOfSquare {
3). public static void main(String[] args) {
4). try (Scanner scanner = new Scanner(System.in)) { ...
5). double side = scanner.nextDouble();
6). //Area of square is side * side. ...
7). //Print area up to two precision.
Similar questions