Advertisement
DrAungWinHtut

menu.bat

Jun 17th, 2025
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.10 KB | None | 0 0
  1. :MENU
  2. REM Main Menu
  3. @echo off
  4. ECHO 1. Calculate Area of Circle
  5. ECHO 2. Calculate Area of Rectangle
  6. ECHO 3. Exit
  7. SET /P choice=Choose an option (1 or 2 or 3) :
  8. IF "%choice%"=="1" GOTO CIRCLE
  9. IF "%choice%"=="2" GOTO RECTANGLE
  10. IF "%choice%"=="3" GOTO EXIT
  11.  
  12.  
  13. :CIRCLE
  14. REM Area of Circle
  15. @echo off
  16. ECHO Area of Circle
  17. SET /P radius=Enter the radius of the circle:
  18. SET /A area=314*%radius%*%radius%/100
  19. REM The formula for the area of a circle is πr², where π is approximated as 3.14
  20. ECHO The area of the circle with radius %radius% is %area%.
  21. REM End of Area of Circle
  22. ECHO Press any key to continue...
  23. PAUSE > NUL
  24. CLS
  25. GOTO MENU
  26.  
  27. :RECTANGLE
  28. REM Area of Rectangle
  29. @echo off
  30. ECHO Area of Rectangle
  31. SET /P length=Enter the length of the rectangle:
  32. SET /P width=Enter the width of the rectangle:
  33. SET /A area=%length%*%width%
  34. ECHO The area of the rectangle with length %length% and width %width% is %area%.
  35. REM End of Area of Rectangle
  36. ECHO Press any key to continue...
  37. PAUSE > NUL
  38. CLS
  39. GOTO MENU
  40.  
  41. :EXIT
  42. REM Exit the script
  43. @echo off
  44. ECHO Exiting the program...
  45. ECHO Goodbye!
  46. EXIT /B
  47.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement