Skip to main content

How to make a calculator from a notepad

Instructions to follow
1)First open notepad
2)Type the following code;

@echo off
color fa
cls
:st
echo What would you want to do?
echo Add +
echo Subtract -
echo Multiply *
echo Divide /
set /p input=Enter =
If %input%==+ goto Add
If %input%==Add goto Add
If %input%==Subtract goto Subtract
If %input%==- goto Subtract
If %input%==* goto Multiply
If %input%==Multiply goto Multiply
If %input%==/ goto Divide
If %input%==Divide goto Divide
:da
cls
goto st

:Add
cls
set /p a=Enter first number to add  =
set /p b=Enter second number to add =
set /a c=a+b
echo[
echo  ------------------------------
echo %a%+%b%=%c%
pause>nul
cls
goto st

:Subtract
cls
set /p a=Enter first number to subtract  =
set /p b=Enter second number to subtract =
set /a c=a-b
echo[
echo  ------------------------------
echo %a%-%b%=%c%
pause>nul
cls
goto st
:Multiply
cls
set /p a=Enter first number to multiply  =
set /p b=Enter second number to multiply =
set /a c=a*b
echo[
echo  ------------------------------
echo %a%*%b%=%c%
pause>nul
cls
goto st
:Divide
cls
set /p a=Enter first number to Divide  =
set /p b=Enter second number to Divide =
set /a c=a/b
echo[
echo  ------------------------------
echo %a%/%b%=%c%
pause>nul
cls
goto st

                                                        Download The Following text:





Comments

Popular posts from this blog

How to Remove Powered by Blogger – Attribution Widget?

In this article, I will be demonstrating how to remove or hide attribution widget ‘Powered by Blogger’ in footer of blogger blogspot blogs.  Before going to the process,  backup your blogger template , while editing html code if anything goes wrong or template modified design doesn’t work or looks good you can restore from backed up template.  Here I have demonstrated you two methods for removing attribution widget. Some blogger templates may not support method 1 then you need to follow method 2 for successfully removing attribution widget. Method 1: Remove ‘Powered by Blogger’ by unlocking Attribution widget Step 1 : Go to your blog “Template” | click on “Edit HTML”. Step 2 : Here on drop-down “jump to widget” option and select Attribution 1 as shown below Step 3: After selecting Attribution 1 widget you will be able to see this line <b:widget id=’Attribution1′ locked=’true’ title=” type=’Attribution’>  on your blogger template. Step 5: Once done click on...

Top 7 Modules in Python Programming language | 2020

Python is a simple programming language yet of very high level and is very much popular. This days the use of python has gone very high and it is expected to be much higher in the upcoming days in the near future. So, today in this article we will be discussing about some modules in python language which are most to be learnt: NumPy: It helps to do basic mathematical operations and complex math with algebraic formulas, statistical operations,etc. It is a valuable python package and is important for machine learning. Pendulum: It helps to do complex coding involving dates and time and is broad form of datetime module. It also manages the time zone automatically hence, it is a replacement for the datetime module. Python imaging library: It makes easy to write codes that involves to open, read and manipulate or modify images in a variety of formats. The Pillow or PIL imaging library is good for importing, manipulation and exporting images. MoviePy: As pillow is to images, moviePy ...

What is a Country? देश भनेकाे के हाे?

Yesterday, on January 13, Nepal's Coat of Arms was updated to add Kalapani and Limpiyadhura as in the new Political map. In this context, we today discuss on what actually 'a country is for it's citizen.' देश भनेकाे के हाे? What is a Country? जनताका लागि देश के हो ? जनताका लागि देश संविधान, कानुन, नागरिकता, सिमाना र झन्डा मात्र हो ? होइन । जनताका लागि देश राजधानी, त्यसबीच ठडिएको दरबार र त्यसको गजुर हो ? होइन । जनताका लागि देश भनेको सरकार हो ? होइन । जनताका लागि देश निर्वाचन क्षेत्र मात्र हो ? हुँदै होइन । त्यसो भए जनताका लागि के हो त देश ? जनताका लागिदेश चार सिमानाभित्रको माटो मात्र होइन । योसँगै जोडिने भावना, प्रेम, ऊर्जा र सपनाहरूको बगैंचा हो । जनताका लागि देश आशा हो । जनताका लागि देश खेतमा झरेको पसिनाको बियाड हो । आन्दोलनहरूमा सडकमा पोखिएको रगत हो । आफ्ना सपनाहरूको कविता हो । जस्तो, एउटा शिशुका लागि आमाको काख । जस्तो, भर्खर हिँड्दै गरेको एउटा बालकका लागि पिताजीको हात । एउटा यात्रीका लागि देश बाटो हो, जसमाथि ऊ आफ्ना पैतालाका डोबहरू छोड्छ र गन्तव्यतिर बढ्छ । देश भनेको ...