howtothings.co.uk

Full Version: HOW TO MAKE A CALCULATOR USING BATCH FILE
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
HOW TO MAKE A CALCULATOR USING BATCH FILE

----------------------------code------------------------------
echo off
cls
echo.
echo This is multiplication calculation
set/p "user=FirstNo=>"
set/p "pass=SecondNo=>"
set /a a=%user%*%pass%
echo so the answers is = %a%
pause >nul
---------------------------end code---------------------------

paste the copied code in your notepad and save as "calculator.bat" or any other name with bat extension
you can change * with +,- and / to perform various operations.
Would be more efficient to ONLY have the answer, and to also use command line args with %0 and %1. I *think* You could make it take 3 args, and make it do all 4 operations with a one-line command.

ermmm Clones! My calculator is broken. :unhappy

[Image: calc.png]
Don't be such a smart arse.