HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

How to make Menu based Calculator using the .bat file or batch scripting

1,547 views November 9, 2018 10:17

Watch on YouTube
ChannelHiTech Wiki

Description from the creator

HiTech Wiki ,

In this videos we are making the manu based calsulator using the .bat or batch scripting file.......

1.First open the "Notepad"

2.Write the code as shown below :

@echo off
title Calculator
:main
echo Menu:
echo 1.Addition
echo 2.Substration
echo 3.Multiplication
echo 4.Division
echo 5.Exit
set /p ch=Enter your choice
if %ch%==1 goto add
if %ch%==2 goto sub
if %ch%==3 goto mul
if %ch%==4 goto div
if %ch%==5 goto exit
:add
cls
echo Enter first number
set /p a=num1 :
echo Enter second number
set /p b=num2 :
set /a sum=a+b
echo Result =%sum%
goto main
:sub
cls
echo Enter first number
set /p a=num1 :
echo Enter second number
set /p b=num2 :
set /a sub=a-b
echo Result =%sub%
goto main
:mul
cls
echo Enter first number
set /p a=num1 :
echo Enter second number
set /p b=num2 :
set /a sum=a*b
echo Result =%sum%
goto main
:div
cls
echo Enter first number
set /p a=num1 :
echo Enter second number
set /p b=num2 :
set /a sum=a/b
echo Result =%sum%
goto main
:exit
echo Thanks for using
timeout /t 3
exit

3. Save the file as Demo.bat

4.Then open the saved Demo.bat file from saved location by double clicking on it......

5.Now use the Calculator




Any querie contact us on : [email protected]

About this tutorial

HiTech Wiki published this 10:17 video tutorial on November 9, 2018. It has been watched 1,547 times on YouTube.

Duration
10:17
Published
November 9, 2018
Views
1,547
Likes
25

Share

This tutorial in other languages