Sunday 6 January 2013

How To create a Calculator using Batch Programming

Hi To All The Mindbenders,
Let me start my very short tutorial which is creating a calculator for our cmd prompt.
 Follow up these steps...

Step 1.
Open up notepad.


Step 2.
 Paste the code from here


@echo off
title Batch Calculator by Devender Mahto
color 1f
:top
echo --------------------------------------------------------------
echo Welcome to Batch Calculator by Devender Mahto
echo --------------------------------------------------------------
echo.
set /p sum=
set /a ans=%sum%
echo.
echo = %ans%
echo --------------------------------------------------------------
pause
cls
echo Previous Answer: %ans%
goto top
pause
exit


Step 3.

Save it as anything.bat and change the file type to all files.

Step 4.
Open the bat file



Step 5.
if you wanna add type 1+1 and click enter and you get 2.
you can use + , - , * and / 


Ask Me If you face any problem regarding any part of this blog...

===(Next is what?)===

0 comments:

Post a Comment