View Code of Problem 74

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

}

Double click to view unformatted code.


Back to problem 74