Created
March 29, 2018 20:40
-
-
Save Abdulazizsayed/205f0892db786f58750f29ba0bc5d9de to your computer and use it in GitHub Desktop.
the pabilonion method for square root
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int e=1,n; | |
cout << "enter the required num : "; | |
cin >> n; | |
for (int i=0; i<1000 ; i++) | |
{ | |
e = (e+(n/e))/2; | |
} | |
cout << "the sqr of " << n << " is : " << e; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment