title: 'If' condition in batch file
body: <p>I am having problems getting the desired result in cmd batch file. I need to print the result in the below mentioned format </p>
  
  <pre><code>@echo off
  setlocal enabledelayedexpansion
  for %%i in (8 7 6 5 4 3 2) do (
  
  echo %%i
  if %%i EQU 8 goto lvl8
  if %%i EQU 3 goto lvl35
  if %%i EQU 2 (goto lvl3) else goto lvls
  
  :lvl8
  set str1=8
  set str2=16
  
  :lvl35
  set str1=3.5
  set str2=4
  
  :lvl3
  set str1=3
  set str2=3.5
  
  :lvls
  set str1=%%i
  
  set /A str2=%%i+1
  
  echo %%i
  rem echo.!str!
  echo.!str1!
  echo.!str2!
  )
  endlocal
  </code></pre>
  
  <p>Expected outputs</p>
  
  <pre><code>8
  8
  16
  7
  7
  8
  6
  6
  7
  5
  5
  6
  4
  4
  5
  3
  3.5
  4
  2
  3
  3.5
  </code></pre>
  
  <p>Right now am getting the following:</p>
  
  <pre><code>8
  Missing operand
  %i
  
  %i
  3.5
  </code></pre>
  
  <p><strong>EDIT:</strong> updated the above question as per Joey's solution.</p>