Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- color 0A
- :startup
- goto input1
- :preinput1
- cls
- echo.
- echo PREVIOUS ANSWER:
- echo %output%
- :input1
- echo.
- echo Insert starting number:
- echo.
- set /p number1=
- goto operation
- :operation
- echo.
- echo (b) to go back
- echo.
- echo (a) for addition
- echo (s) for subtraction
- echo (m) for multiplication
- echo (d) for division
- echo.
- set /p operationchoice=
- if %operationchoice% == a goto addinput2
- if %operationchoice% == s goto subinput2
- if %operationchoice% == m goto mulinput2
- if %operationchoice% == d goto divinput2
- if %operationchoice% == b goto input1
- goto operation
- :addinput2
- echo.
- echo (b) to go back
- echo.
- echo Insert second number:
- echo.
- set /p number2=
- if %number2% == b goto operation
- goto add
- :subinput2
- echo.
- echo (b) to go back
- echo.
- echo Insert second number:
- echo.
- set /p number2=
- if %number2% == b goto operation
- goto sub
- :mulinput2
- echo.
- echo (b) to go back
- echo.
- echo Insert second number:
- echo.
- set /p number2=
- if %number2% == b goto operation
- goto mul
- :divinput2
- echo.
- echo (b) to go back
- echo.
- echo Insert second number:
- echo.
- set /p number2=
- if %number2% == b goto operation
- goto div
- :add
- set /a output = %number1% + %number2%
- echo.
- echo ANSWER:
- echo %output%
- echo.
- pause
- goto preinput1
- :sub
- set /a output = %number1% - %number2%
- echo.
- echo ANSWER:
- echo %output%
- echo.
- pause
- goto preinput1
- :mul
- set /a output = %number1% * %number2%
- echo.
- echo ANSWER:
- echo %output%
- echo.
- pause
- goto preinput1
- :div
- set /a output = %number1% / %number2%
- echo.
- echo ANSWER:
- echo %output%
- echo.
- pause
- goto preinput1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement