To the Top


Last Modified: October 30 2020 14:33:15
File:  root - programs - 80x86_batch - 2008 - 5 - math_example.bat
File Size: 0.42KB


  1. @echo off
  2. rem An Example Batch Program to Calculate 355/113.
  3. rem OS: 2000, XP
  4. rem Zhihua Lai, May 12, 2008
  5. set /a a=355
  6. set /a b=113
  7. set /a c=100
  8. set /a d=a/b
  9. set o=%a%/%b%=%d%.
  10. :work
  11. set /a a=(a-d*b)*10
  12. if "%a%"=="0" goto clean_up
  13. set /a d=a/b
  14. set /a c=c-1
  15. if "%c%"=="0" goto clean_up
  16. set o=%o%%d%
  17. goto work
  18. :clean_up
  19. echo %o%
  20. set o=
  21. set a=
  22. set b=
  23. set c=
  24. set d=

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />