title: If the user wants to input x amount of numbers, how do I manage to keep track of it and then end the program?
body: <p>I am trying to write a program that asks the user to enter a sequence of integers. As the numbers are being input, the program should count the number of odd and even numbers. When the user is finished entering data, the program should display the number of odd numbers and the number of even numbers that were entered.</p>
  
  <p>Can I achieve the above result, without having to use a sentinel value ? 
  Also, if i ask the user "How many numbers would you like to enter?", how do I have the program output "Enter data:" 5 times if the input is "5" ? </p>
  
  <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
  int userInput;
  int evenCount = 0;
  int oddCount = 0;
  cout &lt;&lt; "Odd and Evens ";
  
  do
  {
      cout &lt;&lt; "Please enter an integer: ";
      cin &gt;&gt; userInput;
  
  
      if (userInput % 2 == 0)
      {
          evenCount++;
      }
      else
      {
          oddCount++;
      }
  
  } while (userInput != 0);
  cout &lt;&lt; "You entered " &lt;&lt; oddCount &lt;&lt; " odd numbers, and " &lt;&lt; evenCount - 1 &lt;&lt; " even numbers " &lt;&lt; endl;
  
  system("pause");
  return 0;
  }
  </code></pre>
  
  <p>This is what I am trying to achieve with my program: </p>
  
  <pre><code>How many numbers are you going to enter? 5
  Enter data: -5
  Enter data: 2
  Enter data: 3
  Enter data: 6
  Enter data: 0
  Odd numbers entered: 2
  Even numbers entered: 3
  </code></pre>