/* Newton's Method for Sqaure root*/
#include <stdio.h>
int main()
{
double n,i,t;
printf("Enter no to find out square root \nusing newton's method\n");
scanf("%lf",&n);
i=(n>4)?(n/2):n;
while(!((i*i)==n))
{
t=(i*i)-n;
t=t/(i*2);
i=i-t;
}
printf("\n Square root is %.2lf",i);
return 0;
}