Debugme Eas230

Debugme Eas230 - a = pow( x, 2.0 ); b = sin( a ); //...

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

View Full Document Right Arrow Icon
#include <iostream> #include <cmath> using namespace std; int main () { int x; double a, b, c; char hold; bool debugMe = true; // loop from 1 to 10000 for (x=1; x <= 10000; x++) { // for each value of x, calculate x-squared and sin of x-squared
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: a = pow( x, 2.0 ); b = sin( a ); // display if debugMe is true if (debugMe == true) { cout &lt;&lt; x &lt;&lt; &quot; &quot; &lt;&lt; a &lt;&lt; &quot; &quot; &lt;&lt; b &lt;&lt; endl; } } // display sin of last x-squared cout &lt;&lt;&quot;after x = &quot; &lt;&lt; x &lt;&lt; &quot; b = &quot; &lt;&lt; b &lt;&lt; endl; }...
View Full Document

Ask a homework question - tutors are online