Scanner in=new Scanner(System.in);
int num=in.nextInt();
Systen.out.println(Math.pow(num,0.5));
double squar = Math.pow([value],0.5) // square root of the value
ex :
public class SquareRoot{
public static void main(String []args){
System.out.println(Math.pow (4, 0.5));
}
}
output :
>>2