Advertisement
jwrbg

ReadNum

Feb 14th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 KB | None | 0 0
  1. package com;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class ReadNumber
  6. {
  7.   public static void main(String[] args)
  8.   {
  9.     Scanner scanner = new Scanner(System.in);
  10.     double inputNum= Double.parseDouble(scanner.nextLine()); //TO DO check the input is negative zero or not a number
  11.     double output = Math.sqrt(inputNum);
  12.     System.out.printf("%.5f",output);
  13.   }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement