Package

Source Code of Exercice14

import java.util.Scanner;

public class Exercice14 {
    public static void main (String [] args)
    {
        Scanner scn = new Scanner(System.in);
        System.out.print("Entrez epsilon : ");
        double epsilon = scn.nextDouble();

        double Un = 1, Un1;
        do {
            Un1 = Un + 1 / Un;
            Un = Un1;
        } while (Math.abs(Un1 - Un) > epsilon);

        System.out.println("lim = " + Un1);
    }
}
TOP

Related Classes of Exercice14

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.