View Code of Problem 74

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

Double click to view unformatted code.


Back to problem 74