What's new

Closed To find square root of the number

Status
Not open for further replies.

Bhadz141

Addict
Joined
Jun 1, 2016
Posts
30
Reaction
15
Points
78
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
double number;

Scanner input = new Scanner(System.in);

System.out.println("Enter a number to find its square root: ");
number = input.nextDouble();

System.out.println("Square root of "+ (int)number + " is: "+ Math.sqrt(number));
}
}
 
Status
Not open for further replies.

Similar threads

Back
Top