title: How to display horizontally in C++?
body: <p>There are two lines of out for every iteration of the loop. I want for line a to be on top of line b in every iteration. Moreover, I want to display the next (i=1) iterated line a and b to be horizontal with the previous (i=0) line a and b.   </p>
  
  <pre><code>for (int i = 0; i &lt; 2; ++i){
       cout &lt;&lt; "LOOP" &lt;&lt; endl; //line a
       cout &lt;&lt; i &lt;&lt; endl;      //line b
  }
  </code></pre>
  
  <p>Current output:</p>
  
  <pre><code>LOOP
  0
  LOOP
  1
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>LOOP  LOOP
  0     1
  </code></pre>