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 :: android xml hide 
Java :: print an array java 
Java :: check key is pressed java 
Java :: 8.1.1. Declaring an Array¶ 
Java :: dark mode app android studio 
Java :: load file as string java 
Java :: java remove character from string after 
Java :: java string to float 
Java :: str.substring last 2 java 
Java :: date format in java 
Java :: Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: plugins.flutter.io/webview 
Java :: milliseconds to seconds java 
Java :: Instant class java 
Java :: Get the last day of a month in Java 
Java :: android separator line in view 
Java :: generate serial uuid with intelij 
Java :: java enums 
Java :: java append file 
Java :: default argument in java 
Java :: android view set border programmatically 
Java :: how to find some of digits in java 
Java :: java run code at interval 
Java :: dequeue in java 
Java :: java swing set icon to JFrame 
Java :: java priority queue 
Java :: java add elements array 
Java :: make textview invisible android 
Java :: spring boot access images in resources folder 
Java :: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification 
Java :: set view layout params android 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =