facebook wealth photo facebookwealthformula2_zpsaf35901e.jpg

Monday, 7 April 2014

How To Create A (CMD) Command Line Calculator

Hi friends today i am here with an amazing trick and its about to create a command line
(cmd) calculator with the help of notepad,so to start the process follow the simple steps below:


how to create a notepad calculator


1. Open a blank notepad file.

2. Copy the below code in thes notepad file.


    @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 wsh 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!

3. Select "all files" as file type and save the file as calculator.bat.

4. That's all open the bat file and perform calculations.

Enjoyyyyyyy..........



No comments:

Post a Comment