View Code of Problem 74

#include <stdio.h>
#include <math.h>
int main()
{
	double a,x,t;
  	scanf("lf",&a);
  	x=a/2;
  	while (fabs(x-t)>=1e-5)
        {
        	t=x;
          	x=(x+x/a)/2;
        }
  	printf("%.3lf",x);
}

Double click to view unformatted code.


Back to problem 74