've created this code to find Sqrt without math.h but gives me wrong values ! So what is wrong ??
#include <iostream.h>
#include <conio.h>
main()
{
double n,end,start=0,mid;
cin>>n;
end=n/2;
while(start<end)
{
mid=(start+end)/2;
if ((n-(mid*mid)<=0.001) && (n-(mid*mid)>=0))
{cout<<mid;break; }
if(n>mid*mid)
{start=mid+0.001 ;
end=end;}
if(n<mid*mid)
{end=mid-0.001;
start=start;}
}
getch();
}