Untitled

Run Settings
LanguageC++
Language Version
Run Command
#include <iostream> #include <cmath> using namespace std; int main() { double s = sqrt(5); cout << s << endl; double estimate = 1; for (int i = 1 ;i < 10000000; i++ ){ double newEstimate = 0.5*((estimate + i*0.0001) + 5/(estimate + i*0.0001)); double different = newEstimate - estimate - i/10000; if(different < 0.0001){ cout << " the new estimate is " << newEstimate << endl; break; } } }
Editor Settings
Theme
Key bindings
Full width
Lines