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
Random number calculator help
Moderator: DosItHelp
Re: Random number calculator help
Code: Select all
set random1=%random%
set random2=%random%
set sum=%random2%-%random1%
set /a ans=%sum%
echo %sum%=%ans%
Re: Random number calculator help
thanks, it works perfectly