title: Scanning and printing an array in loop in c/c++
body: <p>I want to make a program that scan from the user the number of lines of input
  like :</p>
  
  <p>Input:</p>
  
  <pre class="lang-none prettyprint-override"><code>3
  zyad sabry 322
  ahmed alaa 11
  john adams 122
  </code></pre>
  
  <p>Output:</p>
  
  <pre class="lang-none prettyprint-override"><code>zyad sabry 322
  ahmed alaa 11
  john adams 122
  </code></pre>
  
  <p>This is my code : </p>
  
  <pre><code>      scanf("%d",&amp;n);
      for(i=0;i&lt;n;i++)
          cin &gt;&gt; name &gt;&gt; lname &gt;&gt; num ;
  
    for(i=0;i&lt;n;i++)
          cout &lt;&lt; name &lt;&lt; " " &lt;&lt; lname &lt;&lt; " " &lt;&lt; num  &lt;&lt; endl;
          return 0;
  </code></pre>