#Post Title #Post Title #Post Title

Make Questions

4. Make Questions
Want to make something interactive ? Need to make questions ? Here is an example of a question made with notepad where the user got the answer correct.

To do this, just type the following code in notepad.
@ECHO OFF
ECHO:
ECHO ………………………………………..
ECHO PRESS 1 or 2 to select your task, or 3 to EXIT.
ECHO ………………………………………..
ECHO.
ECHO 1 – This info was given by Fun PC Life
ECHO 2 – This info was not given by Fun PC Life
ECHO 3 – EXIT
ECHO.
SET /P M=Type 1, 2, or 3, then press ENTER:
echo:
IF %M%==1 GOTO Correct
IF %M%==2 GOTO Wrong
IF %M%==3 GOTO EXIT
:Correct
echo You are right !!
GOTO END
:Wrong
echo You are wrong. This info was really given by Fun PC Life
GOTO END
:END
PAUSE
goto EXIT
:EXIT

Now save the file as Question.bat and run the file.
Please note that the file type should be kept as ALL Files while saving it as a .bat file.
You can modify the code for your convenience. Change the bold text and try it out.

Leave a Reply