Create a program that will accept a number from the user and display its square root.

import java.io.*;
public class SquareRoot
{
    public static void main(String args[])throws IOException
	{ 
	   float number;
	   double sqrRoot;
	   InputStreamReader obj=new InputStreamReader(System.in);
	   BufferedReader objectBR=new BufferedReader(obj);
	   System.out.printIn("Enter the Number");
	   String str=objectBR.readLine();
	   number=Integer.parselnt(str);
	   sqrRoot=Math.sqrt(number);
	   System.out.printIn("Square root of"+number+"is"+sqrRoot);
	}
}
Show Buttons
Hide Buttons