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

Trending Topics

Online now

Members online
890
Guests online
9,101
Total visitors
9,991

Forum statistics

Threads
2,336,591
Posts
29,292,206
Members
1,130,884
Latest member
sparkboom
Back
Top