#include<stdio.h>
float SquareRoot(float num);
int main()
{
float input, ans;
printf("\n Enter The Number : ");
while(scanf("%f", &input) == 1)
{
ans = SquareRoot(input);
printf("\n Square Root : %f\n", ans);
}
return 0;
}
float SquareRoot(float num)
{
if(num >= 0)
{
float x = num;
int i;
for(i = 0; i < 20; i ++)
{
x = (((x * x) + num) / (2 * x));
}
return x;
}
}