mainSR1 - cout << "The...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
/* Comptuing square roots. Author: Eric Van Wyk, Ted Kaminski. Date: Feb 22, 2010 */ #include <iostream> #include <string> using namespace std ; double mysqrt(double number_to_sqrt, double accuracy); int main() { cout << "Computing some sample square roots." << endl << endl ; double x = 3.1415 ;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout &lt;&lt; &quot;The square root of &quot; &lt;&lt; x &lt;&lt; &quot; is &quot; &lt;&lt; mysqrt(x, 0.0001) &lt;&lt; endl ; x = 18.55 ; cout &lt;&lt; &quot;The square root of &quot; &lt;&lt; x &lt;&lt; &quot; is &quot; &lt;&lt; mysqrt(x, 0.0001) &lt;&lt; endl ; x = 456.789 ; cout &lt;&lt; &quot;The square root of &quot; &lt;&lt; x &lt;&lt; &quot; is &quot; &lt;&lt; mysqrt(x, 0.0001) &lt;&lt; endl ; }...
View Full Document

Ask a homework question - tutors are online