Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~313 People Reached
Favorite Forums
Favorite Tags
c++ x 5
Member Avatar for shehata07

'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(); }

Member Avatar for shehata07
0
313