Do calculations with Command Prompt


Do calculations with Command Prompt

The command processor 'cmd.exe' comes with a mini-calculator that can perform simple arithmetic on 32-bit signed integers:

C:\>SET /A 2+2
4
C:\>SET /A 2*(9/2)
8
C:\>SET /A (2*9)/2
9
C:\>SET /A “31>>2″
7

Note that we had to quote the shift operator since it would otherwise be misinterpreted as a “redirect stdout and append” operator.

For more information, type 'set /?' at the command prompt.




Comments

Popular posts from this blog

The ALT codes

How a webcam works?