2 Answers
#include <stdio.h>
int main()
{
float sqrt, temp, n;
printf(“Enter a number\n”);
scanf(“%f”, &n);
sqrt = n / 2;
temp = 0;
while (temp != sqrt)
{
temp = sqrt;
sqrt = (n / sqrt + sqrt) / 2;
}
printf(“The square root of the number is %f”, sqrt);
}