Random number calculator help
Posted: 24 Oct 2010 12:36
hi everyone,
i've been working on a random number calculator
this is what i have already:
set random1=
set /p random1=%random%
set random2=
set /p random2=%random%
set /p sum=%random2%-%random1%
set /a ans=%sum%
echo = %ans%
it goes wrong when i want it to auto calculate, at: set /p sum=%random2%-%random1%
it gives the calculation, but when i want the answer, it says Missing operhand.
i want it to calculate random 2 minus random 1 automaticly. (that i don't have to fill in any numbers).
Thanks
i've been working on a random number calculator
this is what i have already:
set random1=
set /p random1=%random%
set random2=
set /p random2=%random%
set /p sum=%random2%-%random1%
set /a ans=%sum%
echo = %ans%
it goes wrong when i want it to auto calculate, at: set /p sum=%random2%-%random1%
it gives the calculation, but when i want the answer, it says Missing operhand.
i want it to calculate random 2 minus random 1 automaticly. (that i don't have to fill in any numbers).
Thanks