hello,
one question about the fabs function, I had to use it in this code to calculate a square root, but if I run the code without fabs the outcome is the same.
So I wonder why you have to use it.
#include <stdio.h>
#include <math.h>
int main(void){
double x,a=1,y=1;
printf("Enter a positive number: ");
scanf("%lf", &x);
do{
y= a;
a= fabs ((y + x/ y) / 2);}while(a != y);
printf("Square root: %lf\n", a);
return 0;
grtz!