diff options
author | Matthew Strapp <msattr@gmail.com> | 2019-02-20 13:30:37 -0600 |
---|---|---|
committer | Matthew Strapp <msattr@gmail.com> | 2019-02-20 13:30:37 -0600 |
commit | cd88aab2bfae428bad41a51fd64d4b97d1c5c982 (patch) | |
tree | 29192e4f4c25bc09946c9c6a29e7a8d718676bc9 /ee1301/wk3/lab3/RtBab.cpp | |
parent | Get rid of bad comment (diff) | |
parent | MORE LABS (diff) | |
download | homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.gz homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.bz2 homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.lz homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.xz homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.tar.zst homework-cd88aab2bfae428bad41a51fd64d4b97d1c5c982.zip |
Merge branch 'master' of github.com:RosstheRoss/TestingFun
Diffstat (limited to '')
-rw-r--r-- | ee1301/wk3/lab3/RtBab.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ee1301/wk3/lab3/RtBab.cpp b/ee1301/wk3/lab3/RtBab.cpp new file mode 100644 index 0000000..d60beda --- /dev/null +++ b/ee1301/wk3/lab3/RtBab.cpp @@ -0,0 +1,23 @@ +#include <iostream> +#include <cmath> +using namespace std; + +double genNewGuess(double n, double oldGuess); { + New=(oldGuess+n/oldGuess)/2; + oldGuess=New; + return New; +} +int main () { + double temp; + cout << "Enter the Number to find square root: "; + cin >> n; + if (n==0) { + cout << "Nah fam." << endl; + return -1 + } + cout << "Guessing..." + double real=sqrt(n); + do { + + } (while abs(New-real)/real<0.1) +}
\ No newline at end of file |