Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

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));
Comment

java square root

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
Comment

PREVIOUS NEXT
Code Example
Java :: java loop using input user 
Java :: java generate random integer in range 
Java :: arraylist .set java 
Java :: close keyboard android 
Java :: print array 
Java :: nested list java 
Java :: Program type already present: android.support.v4.app.INotificationSideChannel 
Java :: How to efficiently find the longest common subsequence of two strings, in Java? 
Java :: java substring after character 
Java :: final finally finalize 
Java :: java fahrenheit to celsius 
Java :: mockito verify more than once 
Java :: Caused by: java.lang.ClassNotFoundException 
Java :: how to change tablayout current view position in android 
Java :: how to substring in java 
Java :: how to add string to array in java 
Java :: for and while loops java 
Java :: constraintlayout vs coordinatorlayout 
Java :: assert log in unit testing 
Java :: How to get the nth Fibonacci number code in Java using recursion 
Java :: how to use split on a file name java 
Java :: java int array to integer arraylist 
Java :: Quick Sort Java Implementation 
Java :: how to get a character in java in ascii 
Java :: java check string contains uppercase character 
Java :: check if field exists in java 
Java :: create a hashmap 
Java :: actuator spring boot 
Java :: how to replace an element in array in java 
Java :: do you need java installed for kafka 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =