Batch Script language supports the normal Arithmetic operators as any language. Following are the Arithmetic operators available.
The following code snippet shows how the various operators can be used.
@echo off SET /A a = 5 SET /A b = 10 SET /A c = %a%+%b% echo %c% SET /A c = %a%-%b% echo %c% SET /A c = %b%*%a% echo %c% SET /A c = %b%/%a% echo %c% SET /A c =%b% %% %a% echo %c%
The above command produces the following output.
15 -5 50 2 0