import java.util.Scanner;

/**
 * Squareroot
 */
public class Squareroot {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    System.out.println("enter your guess");
    double square = sc.nextDouble();

    // initial the difference
    double epsilon = 1;
    // initial guess
    double guess = square / 2.0;

    while (epsilon > 0.001) {
      double newGuess = (guess + square / guess) / 2.0;
      epsilon = Math.abs(square - guess * guess);
      guess = newGuess;
    }

    System.out.println("The sqaure root of " + square + " is " + guess);
    sc.close();
  }
}
