Answers for "square root of a number in java"

2

square root of a number in java without sqrt

Scanner in=new Scanner(System.in);
int num=in.nextInt();
Systen.out.println(Math.pow(num,0.5));
Posted by: Guest on August-20-2020
1

square root of a number in java

Scanner in=new Scanner(System.in);
int num=in.nextInt();
System.out.println(Math.sqrt(num)); // the sqrt function gives a value in 'double' data type.
Posted by: Guest on August-20-2020

Code answers related to "square root of a number in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language