View Code of Problem 74

#include<stdio.h>
#include<math.h>
int main()
{
    double x;
    scanf("%lf",&x);
    double s=x;
    while(fabs(s*s-x)>0.00001)
    {
        s=(s+x/s)/2.0;
    }
    printf("%.3lf",s);
    return 0;
}

Double click to view unformatted code.


Back to problem 74