diff options
author | RossTheRoss <msattr@gmail.com> | 2019-02-20 19:29:06 +0000 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2019-02-20 19:29:06 +0000 |
commit | 6af4165c7b2dae8240fb4a0c368a93b7d4f7eb96 (patch) | |
tree | a43dd80d67d9426ebb989e602bd9077a7009a6be /ee1301/wk3/lab3/RtBab.cpp | |
parent | FINISH 2B FINALLY (diff) | |
download | homework-6af4165c7b2dae8240fb4a0c368a93b7d4f7eb96.tar homework-6af4165c7b2dae8240fb4a0c368a93b7d4f7eb96.tar.gz homework-6af4165c7b2dae8240fb4a0c368a93b7d4f7eb96.tar.bz2 homework-6af4165c7b2dae8240fb4a0c368a93b7d4f7eb96.tar.lz homework-6af4165c7b2dae8240fb4a0c368a93b7d4f7eb96.tar.xz homework-6af4165c7b2dae8240fb4a0c368a93b7d4f7eb96.tar.zst homework-6af4165c7b2dae8240fb4a0c368a93b7d4f7eb96.zip |
MORE LABS
Diffstat (limited to 'ee1301/wk3/lab3/RtBab.cpp')
-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 |