- @ECHO OFF
- :prompt
- SET /P age="Enter age: "
- IF "%age%"=="18" (
- ECHO You're an adult now, time to pay rent...
- ) ELSE IF %age% GEQ 18 (
- REM The ELSE IF line works only if the first condition fails.
- REM Normally both conditions are true if %age%=18
- ECHO You're 18 or over, welcome to the pub!
- ) ELSE (
- ECHO Get outta here, you're %age%
- )
- ECHO.
- GOTO:prompt