title: C++ using Stacks & Queues to separate even & odd numbers
body: <p>Im trying to implement the Even or Odd numbers in different stacks &amp; queues. Here is my code: </p>
  
  <p>How I can display my Stack &amp; Queue?
  How I can separate in Odd or Even in any queue?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;stack&gt;
  #include &lt;queue&gt;
  using namespace std;
  
  int main()
  {
  stack &lt;int&gt; s1;
  queue &lt;int&gt; q1;
  int num[10]={0};
  
  for(int i = 0; i &lt; 10; i++)
  {
      cout &lt;&lt; "Enter Number " &lt;&lt; i &lt;&lt; ": ";
      cin &gt;&gt; num[i];
  
      s1.push(num[i]);
  }
  
  int s2;
  int q2;
  cout &lt;&lt; "In Stack" &lt;&lt; "\t" &lt;&lt; "In Queue" &lt;&lt; endl;
  
  while(!q1.empty())
  {
      for(int i = 0; i &lt;10; i++)
      {
          if(num[i]%2 == 0)
          {
              s2 = s1.top();
              s1.pop();
          }
          else
          {
              q2 = q1.front();
              q1.pop();
          }
      }
      cout &lt;&lt; s2 &lt;&lt; "\t\t" &lt;&lt; q2 &lt;&lt; endl;
  }
  
   return 0;
  }
  </code></pre>