write a program in Java to accept the area of a square and find its diagonal and perimeter
Answers
Answered by
0
Answer:
Explanation:
import java.util.*;
class square
{
public static void main()
{
Scanner in=new Scanner(System.in);
int a,b=0,c=0,d=0;
System.out.println("Enter the area of the square");
a=in.nextInt();
d=Math.sqrt(a);
c=d*(Math.sqrt(2));
b=4*d;
System.out.println("diagonal :" +c);
System.out.println("perimeter :" +b);
}
}
Similar questions