Multiple choice technology testing

What is the output of the following code snippet @echo off set var = 1 %var%+=1 echo var

  1. 2

  2. 3

  3. 1

  4. Syntax Error

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The batch script contains a syntax error on the line '%var%+=1'. This is not valid batch syntax - arithmetic operations require 'set /a var=%var%+1'. Additionally, 'set var = 1' creates a variable with a space in the name, and 'echo var' prints the literal string 'var' rather than the variable's value.