View Code of Problem 74

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main(){
	double x1,x2,x;
	x1=1.0;
	scanf("%lf",&x);
	while(fabs((x1+x/x1)/2-x1)>0.00001){
		x1=(x1+x/x1)/2;
	}
	printf("%.3lf\n",x1);
	
	return 0;
}

Double click to view unformatted code.


Back to problem 74