Advertisement
l3arnf0x

BatchFun1

Jun 16th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.16 KB | None | 0 0
  1. rem This is a fun program written in batch.
  2. @echo off
  3. cls
  4. :start
  5. title Lame Calculator v1.0
  6. color 0a
  7. echo Loading.
  8. ping localhost -n 2 > nul
  9. cls
  10. echo Loading..
  11. ping localhost -n 2 > nul
  12. cls
  13. echo Loading...
  14. ping localhost -n 2 > nul
  15. cls
  16. echo Welcome to a lame calculator
  17. set /p operation=Choose the operation (add, subtract, divide, multiply):
  18. set /p num1=Enter the first number:
  19. set /p num2=Enter the second number:
  20. if %operation%==add goto :add
  21. if %operation%==subtract goto :subtract
  22. if %operation%==divide goto :divide
  23. if %operation%==multiply goto :multiply
  24. :add
  25. set /a result=%num1%+%num2%
  26. echo The result of adding %num1% and %num2% equals %result%.
  27. goto :choice
  28. :subtract
  29. set /a result=%num1%-%num2%
  30. echo The result of subtracting %num2% from %num1% is: %result%.
  31. goto :choice
  32. :divide
  33. set /a result=%num1%/%num2%
  34. echo The result of dividing %num1% by %num2% is: %result%.
  35. goto :choice
  36. :multiply
  37. set /a result=%num1%*%num2%
  38. echo The result of multiplying %num1% by %num2% is: %result%.
  39. :choice
  40. set /p value=Would you like to use calculator again[y/n]:
  41. if %value%==y goto :start
  42. :end
  43. echo Thanks for using the Lame Calculator v1.0!!
  44. pause > nul
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement