Write a program in java to enter the perimeter of a square and calculate its side and area
Answers
Answered by
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
Business Studies,
6 months ago
English,
6 months ago
Math,
6 months ago
Chemistry,
1 year ago
Social Sciences,
1 year ago
Math,
1 year ago