🔒 Closed To find square root of the number

Status
Not open for further replies.

Bhadz141

Grasshopper
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.

About this Thread

  • 1
    Replies
  • 922
    Views
  • 2
    Participants
Last reply from:
Xifu

Trending Topics

Online now

Members online
371
Guests online
11,927
Total visitors
12,298

Forum statistics

Threads
2,370,834
Posts
29,455,731
Members
1,031,528
Latest member
chikoy108104
Back
Top