View Code of Problem 74

#include<stdio.h>
int main()
{
    double x1,x2,a;
    scanf("%lf",&a);
    x1=a/2;
    if(fabs(x1-x2)>=0.00001)
    {
        x2=x1;
        x1=(x2+a/x2)/2;
    }
    printf("%.3lf",x1);
    return 0;
}

Double click to view unformatted code.


Back to problem 74