title: usage of scanf inside while test condition
body: <p>I want to store a series of integers till i press an enter in an array.How can i implement that</p>
  
  <p>Input:
  1(tab space)2(tab space)3(tab space)4(tab space)enter</p>
  
  <p>i tried doing this</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  main()
  {
  int i,j,c,d;
  int a[5];
  for(i=0;i&lt;2;i++){
          j=0;
      while((d=scanf("%d",&amp;c))==1){
           a[j]=c;
           j=j+1;
      }
   }
  }
  </code></pre>
  
  <p>I dont know how scanf works and using scanf return value.Please explain how i can store this input if its not impossible to do so with scanf and also </p>
  
  <p>2)What else can be used inside scanf along with %d ?</p>
  
  <p>I have a file with 200 rows with numbers like this 
  (NOTE: each row has varied number of values but all numbers are less than 200)</p>
  
  <pre><code>1\t2\t3\t4\t5\t
  2\t3\t4\t5\t6\t7\t8\t
  11\t12\t13\t
  .
  .
  200
  </code></pre>
  
  <p>...                 so i have to store this as an adjacency list representation </p>