This web page requires JavaScript to be enabled.

JavaScript is an object-oriented computer programming language commonly used to create interactive effects within web browsers.

How to enable JavaScript?

CẤU TRÚC VÀ CÁC HÀM THAO TÁC TRÊN SỐ PHỨC

10cth1-2 October 27, 2010 Nam Le 0
#include <stdio.h>
#include <math.h>

void main()
{
    double a, xn, ketqua;

    printf("\nNhap vao so muon tinh can bac hai : ");
    scanf("%lf", &a);
    xn = (a+1)/2;
    do {
        ketqua = xn;
        xn = 0.5 * (xn + a/xn);
    } while (fabs(xn-ketqua) > 0.0001);
    printf("\nKet qua = %lf", xn);
    getch();
}

Last modified on March 31st, 2021 at 12:50 am

Nam Le
lequocnam



0 responds

Leave a Reply

Your email address will not be published. Required fields are marked *