title: C program that returns current answer and previous answer
body: <p>I've got this code that converts the numbers received as parameters form decimal to binary. Each parameter should appear on a new line.</p>
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(int argc, char *argv[])
  {
      if (argc &lt; 2)
      {
          printf(&quot;Invalid number of arguments.&quot;);
          return 0;
      }
      
      int counter=0;
      int decimal, binar[100], rest, i = 0;
      
      while(counter&lt;argc)
      {
      decimal = atoi(argv[counter]);
      rest = decimal;
      counter++;
      while (rest != 0)
      {
          binar[i] = rest % 2;
          rest = rest / 2;
          i++;
      
      }
      for (int j = i - 1; j &gt;= 0; j--)
          printf(&quot;%d&quot;, binar[j]);
      printf(&quot;\n&quot;);
      }
  
      printf(&quot;\n&quot;);
      return 0;
  }
  </code></pre>
  <p>The problem when running the program such as:</p>
  <pre><code> ./biti 1 2 3 4
  
  1
  101
  11101
  10011101
  </code></pre>
  <p>It returns the current number followed by the previous answers, how can i fix this?</p>