Computer Science, asked by adfrt, 1 year ago

Write a program in java to enter the perimeter of a square and calculate its side and area

Answers

Answered by Anonymous
3

import java.util.*;

public class Side_Area

{

Scanner in=new Scanner(System.in);

float p, s, a;

System.out.println("Enter the perimeter");

p=in.nextFloat();

s=p/4;

a=Math.pow(s,2);

System.out.println("The side is"+s);

System.out.println("The area is"+a);

}

}

Similar questions