Header Ads

test

BASIC CALCULATON CALCULATER IN BATCH PROGRAMMING

 

Batch program for basic calculation BY PIYUSH.

   1: @echo off
   2: :start
   3: echo Program for basic calculation(Beta)
   4:  
   5: echo ----------------------
   6: echo Add ----------- 1
   7: echo Subtract ------ 2
   8: echo Multiply ------ 3
   9: echo Division ------ 4
  10: echo Exit ---------- 5
  11: echo ----------------------
  12: set /p "choice=Select an option:-"
  13: if %choice%==5 goto %choice%
  14: set /p "a=Enter First Number :"
  15: set /p "b=Enter Second Number :"
  16: set /a a=%a%
  17: set /a b=%b%
  18:  
  19: goto %choice%
  20: echo Invalid Choice
  21: pause
  22: cls
  23: goto start
  24:  
  25: :1
  26: set /a c=%a% + %b%
  27: echo %a% + %b% = %c%
  28: pause>;nul
  29: cls
  30: goto start
  31:  
  32: :2
  33: set /a c=%a% - %b%
  34: echo %a% - %b% = %c%
  35: pause>;nul
  36: cls
  37: goto start
  38:  
  39: :3
  40: set /a c=%a% * %b%
  41: echo %a% X %b% = %c%
  42: pause>;nul
  43: cls
  44: goto start
  45:  
  46: :4
  47: set /a c=%a% / %b%
  48: set /a d=%a%-(%c% * %b%)
  49: echo %a% / %b% = %c% and %d% remainder
  50: pause>;nul
  51: cls
  52: goto start
  53:  
  54:  
  55: :5
  56: echo Thanks for using!
  57: pause>;nul
  58: exit

This Batch Program is made by Piyush.

No comments

please write your mail id for contact: