How to Make a Command Prompt Calculator
How to Make a Command Prompt Calculator
Making calculations using Windows calculator can get very tedious. Creating your own Command prompt calculator will make your life much easier.
Steps

Open the Notepad app. Click the Start menu and type "notepad". This will be the first option.

Copy the following code. Highlight the entire code, right-click it, and click Copy. @echo off :start Echo Press 1 for Addition echo Press 2 for Subtraction echo Press 3 for Multiplication echo Press 4 for Division echo Press 5 to Quit set /p type= if %type%==1 goto a if %type%==2 goto b if %type%==3 goto c if %type%==4 goto d if %type%==5 goto e :a echo Addition echo Please choose the 2 numbers you wish to add set /p num1= set /p num2= echo %num1%+%num2%? pause set /a Answer=%num1%+%num2% echo %Answer% pause goto start :b echo Subtraction echo Please choose the 2 numbers you wish to subtract set /p num1= set /p num2= echo %num1%-%num2%? pause set /a Answer=%num1%-%num2% echo %Answer% pause goto start :c echo Multiplication echo Please choose the 2 numbers you wish to multiply set /p num1= set /p num2= echo %num1%*%num2%? pause set /a Answer=%num1%*%num2% echo %Answer% pause goto start :d echo Division echo Please choose the 2 numbers you wish to divide set /p num1= set /p num2= echo %num1%/%num2%? pause set /a Answer=%num1%/%num2% echo %Answer% pause goto start :e echo. Done!

Paste the code into Notepad. Right-click the empty area in the Notepad and click Paste.

Save the file. Click File, and then click Save As.... Change the "Save as type" box to "All Files" Type "anything.bat" into file name and click "Save".

Double-click on the file. This will open it. You'll see a window with listed instructions.

Follow the instructions. Your answer will be displayed.

What's your reaction?

Comments

https://ugara.net/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!