# how do I input "Square root of" Java?

How do input :

The square root of (vertical pixels^2+Horizontal pixels^2) in Java?

**Voters**

Check these websites:-

These websites might help you now:-

**Click here**

**Click here**

They will teach you the step-by-step process of getting the output.

Thanks!

**Hope this helps**

You can use `Math.sqrt()`

for that. BTW, to square a number, you have to use `Math.pow()`

. `^`

is reserved for `XOR`

.

`double verticalPixels // = ...; double horizontalPixels // = ...; System.out.println("Square Root of Positive Number: " + Math.sqrt(Math.pow(verticalPixels, 2) + Math.pow(horizontalPixels, 2));`

hey there,

to input in java, you can do (I think): `Scanner sc=new Scanner(System.in);`

here are some websites on input that can help you:

https://www.javatpoint.com/how-to-get-input-from-user-in-java

https://www.w3schools.com/java/java_user_input.asp

https://www.programiz.com/java-programming/basic-input-output

for the square root:

i found this:

The java.lang.Math.sqrt() returns the square root of a value of type double passed to it as argument. If the argument is NaN or negative, then the result is NaN. If the argument is positive infinity, then the result is positive infinity. If the argument passed is positive zero or negative zero then the result will be same as that of the argument.

read more:

https://www.edureka.co/blog/java-sqrt-method/

https://beginnersbook.com/2019/02/java-program-to-find-square-root-of-a-number-without-sqrt/

I am not sure if this is still relevant but you can check this article: https://www.scaler.com/topics/square-root-in-java/ this will help you understand SQRT,