#include #include #define eps 0.000000000000001 int main(void) { int i; double x,y,a; printf("Input positive number:\n"); scanf("%lf",&a); x=a;i=0; do{ i++; x=(x+(y=a/x))*0.5; printf("i=%d x=%20.16lf\n",i,x); } while(fabs(x-y)>eps); printf("Converged Result: x=%30.20lf\n",x); return 0; }