title: C++ beginner programming - loops and while statements
body: <p><img src="https://i.stack.imgur.com/biTp1.png" alt="FlowChart"></p>
  
  <p>The flowchart above represents an algorithm that displays the numbers 20, 40, 60, 80, 100, 120, 140, 160, 180 on the screen. Code the algorithm into a program using the while statement. The counter variable should be an int variable named count. Save and run the program. Test the program to see if you get the correct output. Correct any errors, when the program is running correctly copy and paste the IPO chart and the program code into a word document.</p>
  
  <p>I just started C++ and I'm unsure of how to use the while statement and writing the code. Help would be appreciated. So far, here's my code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main ()
  {
    int count;
    count = 10
  
  ;  while (count &lt; 200) {
      cout &lt;&lt; count &lt;&lt; ", ";
      count*=2;
    }
  
    system("pause");
    return 0;
  }
  </code></pre>
  
  <p>How do I "add 10 to counter" and also display the numbers listed above? (20, 40, 60, 80, 100, 120, 140, 160, 180)
  so far, it only displays 10, 20, 40, 80, 160
  I am unsure of how to also display the numbers in between while still doubling it?
  Thanks! </p>