Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rem This is a fun program written in batch.
- @echo off
- cls
- :start
- title Lame Calculator v1.0
- color 0a
- echo Loading.
- ping localhost -n 2 > nul
- cls
- echo Loading..
- ping localhost -n 2 > nul
- cls
- echo Loading...
- ping localhost -n 2 > nul
- cls
- echo Welcome to a lame calculator
- set /p operation=Choose the operation (add, subtract, divide, multiply):
- set /p num1=Enter the first number:
- set /p num2=Enter the second number:
- if %operation%==add goto :add
- if %operation%==subtract goto :subtract
- if %operation%==divide goto :divide
- if %operation%==multiply goto :multiply
- :add
- set /a result=%num1%+%num2%
- echo The result of adding %num1% and %num2% equals %result%.
- goto :choice
- :subtract
- set /a result=%num1%-%num2%
- echo The result of subtracting %num2% from %num1% is: %result%.
- goto :choice
- :divide
- set /a result=%num1%/%num2%
- echo The result of dividing %num1% by %num2% is: %result%.
- goto :choice
- :multiply
- set /a result=%num1%*%num2%
- echo The result of multiplying %num1% by %num2% is: %result%.
- :choice
- set /p value=Would you like to use calculator again[y/n]:
- if %value%==y goto :start
- :end
- echo Thanks for using the Lame Calculator v1.0!!
- pause > nul
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement