Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo Michael Harrison - %time% %date%>>results.txt
- :whileLoop
- set /p numberOne="Enter an Integer (999 to exit): "
- :: Check to make sure we got a number and not string input
- set /a numberOneVal="%numberOne%"*1
- if %numberOneVal% EQU 0 (
- echo Not a Number!
- goto whileLoop
- )
- :: Check to see if we have 999 exit
- if %numberOne% EQU 999 (
- goto getMeOutOfHere
- )
- set /p numberTwo="Enter a 2nd non-zero Integer (999 to exit): "
- :: Check to make sure we got a real positive integer
- if %numberTwo% EQU 0 (
- echo You have entered a zero!
- goto whileLoop
- )
- :: Check to make sure we got a number and not string input
- set /a numberTwoVal="%numberTwo%"*1
- if %numberTwoVal% EQU 0 (
- echo Not a Number!
- goto whileLoop
- )
- :: Check to see if we have 999 exit
- if %numberTwo% EQU 999 (
- goto getMeOutOfHere
- )
- set /a moduloVal="%numberOne%" %% "%numberTwo%"
- echo Number One: %numberOne% Number Two: %numberTwo% Modulus: %moduloVal%
- (echo %numberOne% %% %numberTwo% = %moduloVal%)>>results.txt
- goto whileLoop
- :getMeOutOfHere
- echo Exiting Program
- pause
- exit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement