Spaghetti code means a code snippet that uses many, and often confusing structures. Such as GOTOs, exceptions and inconsistent code.
Examples and Solutions
Example A
@echo off
set /a counter=0
:Loop
set /a counter=%counter% + 1
echo %counter%
if %counter% equ 10 goto :exit
goto :Loop
...