View Code of Problem 74

#include "stdio.h"
#include "math.h"
#include "string.h"

struct data
{
	int hight;
	int money;
	char name[25];
};

void main()
{	
	double x;
	scanf("%lf",&x);
	double b=1.0,a;
	for(;b-a>=1.0e-5||a-b>=1.0e-5;)
	{
		a=b;
		b=(a+x/a)/2.0;
	}
	printf("%.3lf",b);

}

Double click to view unformatted code.


Back to problem 74