title: batch file equivalent for this code
body: <p>HI i want to implement this C code in batch file</p>
  
  <pre><code>int i;
  scanf("%d", &amp;i);
  for(int j = 0;j&lt;i;j++)
  {
    scanf("%d",&amp;j);
    printf("%d",j);
  }
  </code></pre>
  
  <p>I would run the c program using > redirection in DOS so that the printed output comes to me in a file. I want to do the same thing in my batch file where i could write something like </p>
  
  <pre><code> echo %variable% &gt;&gt; file
  </code></pre>
  
  <p>but it doesn't work for me</p>
  
  <pre><code>@echo off
  for %%i in (1 2 3) do (
  set /p c=enter a name?
  echo %%i
  echo %c% &gt;&gt; file.txt
  )
  </code></pre>
  
  <p>what is wrong?</p>