title: How do I properly perform modulus operations in Batch?
body: <p>I'm trying to write a batch file that performs operations depending on the result of a modulus operation performed on a set variable.  However, I can't seem to get it quite right.</p>
  
  <p>To first of all test my syntax for the mathematical operation, I've been trying to get a simpler script to produce desired results.</p>
  
  <pre><code>:START
  SETLOCAL
  SET /P Input-Num="Input Number: "
  SET /A Input-Num=%Input-Num% %% 2
  ECHO %Input-Num%
  ENDLOCAL
  PAUSE 
  :END
  </code></pre>
  
  <p>If I input <code>5</code>, the expected output is <code>1</code>.  However, instead I get a message saying <code>Missing operator.</code> and then it outputs <code>5</code>.</p>
  
  <p>What am I doing wrong here?</p>