Thursday, October 6, 2011

Create own calculator using notepad

Calculator is a very important function to calculating any thing.Generally we use windows default calculator to calculating.But you can easily make a calculator using notepad.yes,it's very interesting..First open notepad and copy same as below:


@echo off
color 4A
title MY CALCULATOR
:loop
cls
echo created by Afzal
echo _
echo email:afzalarefinshv10@gmail.com
echo web:www.techhelpbd.blogspot.com


echo.
echo My Calculator

echo ———————————————– echo * = MULTIPLY
echo + = ADD
echo – = SUBTRACT
echo 2 = SQUARED
echo / = DIVIDE
echo After an equation, type CLEAR to clear the screen of your equations, type KEEP to leave them there, or type EXIT to leave.
:noclear
set /p UDefine=
set /a UDefine=%UDefine%
echo.
echo =
echo.
echo %UDefine%
echo KEEP, CLEAR, OR EXIT?
set /p clearexitkeep=
if %clearexitkeep%==CLEAR goto loop
if %clearexitkeep%==KEEP echo. && goto noclear
if %clearexitkeep%==EXIT (exit)
:misspell
echo.
echo ———————————————–
echo You misspelled your command. Please try again (make sure you are typing in all caps LIKE THIS).
echo Commands:
echo CLEAR Clear all previous equations and continue calculating.
echo KEEP Keep all previous equations and continue calculating.
echo EXIT Leave your calculating session
echo Enter in a command now.
set /p clearexitkeep=
if %clearexitkeep%==CLEAR goto loop
if %clearexitkeep%==EXIT (exit)
if %clearexitkeep%==KEEP goto noclear
goto misspell


Now go to File/Save as and select save as file Allfiles and named the file as My Calculator.bat.Then ok.Now you can see a file named My Calculator.Open it and calculate with it.It's become a small calculator of yours... :)

No comments:

Post a Comment