@echo off
write a script that declares 2 numeric variables. the value should be input when the script is run. the script should print the sum of the 2 numbers
@echo off
write a script that declares 2 numeric variables. the value should be input when the script is run. the script should print the sum of the 2 numbers
Windows batch files don't have typed variables. The best you could do would be something like this, which depends on valid input from the user.
@echo off
set /p first=First number:
set /p second=Second number:
set /a sum=%first% + %second%
echo Sum = %sum%
- kb -