#include int main() { float x,y,a,tol,dif; printf("Enter a positive real number: "); scanf("%f",&a); printf("Enter the tolerance: "); scanf("%f",&tol); x=1.0; y=(x+a/x)/2; if(x > y) dif = x-y; else dif = y-x; while(dif > tol) { x=y; y=(x+a/x)/2; if(x > y) dif = x-y; else dif = y-x; } printf("Square root of %f is %f\n",a,y); }