×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: MD Sabbir Hossain
Added: Jan 19, 2017 6:54 AM
Views: 9
Tags: root java
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package rootsquare1;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11.  *
  12.  * @author sabbir
  13.  */
  14. public class RootSquare1 {
  15.  
  16.     /**
  17.      * @param args the command line arguments
  18.      */
  19.     public static void main(String[] args) {
  20.         // TODO code application logic here
  21.         double y;
  22.         Scanner squa=new Scanner(System.in);
  23.         System.out.println("Please Enter The Number Want To Root:");
  24.         double x = squa.nextDouble();
  25.         y=Math.sqrt(x);
  26.         System.out.println("The root of:"+x+"="+y);
  27.     }
  28.    
  29. }
  30.