Reputation:
Can someone tell me what is wrong with my batch script? I just doesn't work...
@echo off
:start
echo please enter a mathamatical equation
set /p varia=
set /a %varia%
pause
goto start
If you go into command prompt and type in
set /a (9*5+4-9)/10
the next line is
4
So my idea is putting it into a batch script and use variables, but no good. I even tried just
set /a 5+5
but that failed too. For some reason the cmd command doesn't work in a batch file.
Upvotes: 0
Views: 59
Reputation: 6620
Instead try this:
@echo off
:start
echo Please enter a mathamatical equation:
set /p varia=
set /a answer=%varia%
echo =%answer%
pause
goto start
As you have turned echo off
the variable's value won't be echoed.
Mona
Upvotes: 2