HI i want to implement this C code in batch file
int i;
scanf("%d", &i);
for(int j = 0;j<i;j++)
{
scanf("%d",&j);
printf("%d",j);
}
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
echo %variable% >> file
but it doesn't work for me
@echo off
for %%i in (1 2 3) do (
set /p c=enter a name?
echo %%i
echo %c% >> file.txt
)
what is wrong?