public static void main(String[] args) {
double a =26;
double xnew=a/2;
double xold;
do {
xold=xnew;
xnew=(xold + a/xold)/2;
System.out.println("xnew="+ xnew);
}
while (Math.abs(xnew-xold)>1e-4);
System.out.println("Akar Dari"+a+"="+xnew);
}
}
Jangan Pernah Menyerah
0 komentar:
Posting Komentar