Advertisement
Najeebsk

CMD-CALCULATOR.bat

May 7th, 2022
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 3.13 KB | None | 0 0
  1. TITLE NSK Advanced Calculator
  2. @ECHO OFF
  3. CLS
  4. ECHO -by Najeeb Shah Khan
  5.  
  6. :OPT
  7. color 1f
  8. Cls
  9. ECHO --------------------------------------------------------------------------------
  10. ECHO[
  11. ECHO                                CMD CALCULATOR V3.0
  12. ECHO                                BY NAJEEB SHAH KHAN
  13. ECHO[
  14. ECHO --------------------------------------------------------------------------------
  15. ECHO[
  16. ECHO[
  17. ECHO    + = Sum
  18. ECHO[
  19. ECHO    - = Sub
  20. ECHO[
  21. ECHO    / = Division
  22. ECHO[
  23. ECHO    * = Multiply
  24. ECHO[
  25. ECHO    ~ = Exit
  26. ECHO[
  27. ECHO[
  28. ECHO --------------------------------------------------------------------------------
  29. ECHO[
  30. SET/P ch=" Enter Symbol "
  31. IF %ch% EQU + GOTO:SUM
  32. IF %ch% EQU - GOTO:SUB
  33. IF %ch% EQU / GOTO:DIV
  34. IF %ch% EQU * GOTO:MUL
  35. IF %ch% EQU ~ GOTO:EXIT
  36. IF %ch% GTR . GOTO:ERROR
  37.  
  38. :SUM
  39. CLS
  40. ECHO -------------------------------------------------------------------------------
  41. ECHO[
  42. ECHO                                       SUM
  43. ECHO[
  44. ECHO -------------------------------------------------------------------------------
  45. ECHO[
  46. set /p A=" Enter First Number = "
  47. ECHO[
  48. set /p B=" Enter Second Number = "
  49. SET /A C=A+B
  50. ECHO[
  51. ECHO -------------------------------------------------------------------------------
  52. ECHO.
  53. ECHO %A%+%B%=%C%
  54. ECHO.
  55. PAUSE
  56. GOTO:OPT
  57.  
  58. :SUB
  59. CLS
  60. ECHO -------------------------------------------------------------------------------
  61. ECHO[
  62. ECHO                                   SUBTRACTION
  63. ECHO[
  64. ECHO -------------------------------------------------------------------------------
  65. ECHO[
  66. set /p A=" Enter First Number = "
  67. ECHO[
  68. set /p B=" Enter Second Number = "
  69. SET /A C=A-B
  70. ECHO[
  71. ECHO -------------------------------------------------------------------------------
  72. ECHO.
  73. ECHO %A%-%B%=%C%
  74. ECHO.
  75. PAUSE
  76. GOTO:OPT
  77.  
  78. :MUL
  79. CLS
  80. ECHO -------------------------------------------------------------------------------
  81. ECHO[
  82. ECHO                                  MULTIPICATION
  83. ECHO[
  84. ECHO -------------------------------------------------------------------------------
  85. ECHO[
  86. set /p A=" Enter First Number = "
  87. ECHO[
  88. set /p B=" Enter Second Number = "
  89. SET /A C=A*B
  90. ECHO[
  91. ECHO -------------------------------------------------------------------------------
  92. ECHO.
  93. ECHO %A%*%B%=%C%
  94. ECHO.
  95. PAUSE
  96. GOTO:OPT
  97.  
  98. :DIV
  99. CLS
  100. ECHO -------------------------------------------------------------------------------
  101. ECHO[
  102. ECHO                                    DIVISION
  103. ECHO[
  104. ECHO -------------------------------------------------------------------------------
  105. ECHO[
  106. set /p A=" Enter First Number = "
  107. ECHO[
  108. set /p B=" Enter Second Number = "
  109. SET /A C=A/B
  110. ECHO[
  111. ECHO -------------------------------------------------------------------------------
  112. ECHO.
  113. ECHO %A%/%B%=%C%
  114. ECHO.
  115. PAUSE
  116. GOTO:OPT
  117.  
  118. :ERROR
  119. CLS
  120. ECHO -------------------------------------------------------------------------------
  121. ECHO[
  122. ECHO                                     ERROR
  123. ECHO[
  124. ECHO -------------------------------------------------------------------------------
  125. ECHO.
  126. ECHO Wrong Options!
  127. ECHO.
  128. ECHO (+) For Add Numbers
  129. ECHO (-) For Substract number
  130. ECHO (/) for Division
  131. ECHO (*) for Multiply.
  132. ECHO.
  133. PAUSE
  134. GOTO:OPT
  135.  
  136. :EXIT
  137. EXIT
  138.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement