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

Trending Topics

Online now

Members online
1,316
Guests online
3,422
Total visitors
4,738

Forum statistics

Threads
2,305,884
Posts
29,168,354
Members
1,195,478
Latest member
PiekaBoo
Back
Top