Sunday 28 August 2011

Batch file program -Simple Integer Calculator

                                                                      
Here you can see a simple code to create calculator using batch file.
Just copy the following code
Paste it in notepad

Save it as any name.bat
Open the newly created batch file.
Cmd will appear.
Put the numbers with operators(Ex : 8 * 9)
Press Enter to get answer.
That's it
CODE 


@echo off
title  Calculator
:1
echo Enter operands with operators(Ex: 5 + 6):
set /p input=
set /a result=%input%
echo Result is: %result%
:2
echo Continue - y , Exit- n
set /p "choice=>"
if %choice%==y goto 1
if %choice%==n goto end
echo Invalid choice
goto 2
:end
exit

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More