Answer:
import java.util.Scanner;
class square_root
{
public static void main (String[] args)
{
Scanner s=new Scanner(System.in);
System.out.print("Enter the area: ");
double areaOfSquare=s.nextDouble();
if(areaOfSquare<0)
{
System.out.println("INVALID");
System.exit(2);
}
System.out.println("The side of the square is: "
+Math.sqrt(areaOfSquare));
}
}
Explanation: