View Code of Problem 74

#include<stdio.h>
#include<math.h>
int main(){
	float a,x,t;
	scanf("%f",&a);
	x=a/2;
	while(fabs(x-t)<0.00001){
		t=x;
		x=(x+a/x)/2;
	}
	printf("%0.3f",x);
}

Double click to view unformatted code.


Back to problem 74