0

by input the value of variable is not changing, but on next iteration , its show the previous input value.

set /a firstNum=0
set /a secondNum=0
:while
if %firstNum% NEQ -99 (
    set /p firstNum="Enter first number"
    echo first number is %firstNum%
)
if %secondNum% NEQ -99 (
    :2input
    set /p secondNum="Enter second Numer"
    echo second number is %secondNum%
    if %secondNum% == 0  ( goto :2input )
)
goto :while
0

1 Answer 1

1

No idea what you want to achieve with this peace of nonsense but if you want your values to chenge you have to add SETLOCAL ENABLEDELAYEDEXPANSION at the beginning of your code and call your variables as !variable! instead of %variable%.

Sign up to request clarification or add additional context in comments.

1 Comment

sorry bro next time i will try to ask you first "may i share my code here or not?" but thanks , it works

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.