🔒 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
  • 868
    Views
  • 2
    Participants
Last reply from:
Xifu

Online now

Members online
376
Guests online
1,403
Total visitors
1,779

Forum statistics

Threads
2,275,513
Posts
28,963,781
Members
1,232,826
Latest member
Daniella
Back
Top