RosettaCodeData/Task/Arithmetic-Integer/Batch-File/arithmetic-integer.bat

12 lines
322 B
Batchfile
Raw Permalink Normal View History

2026-02-01 16:33:20 -08:00
@echo off
echo Batch rounds towards zero and its modulus should match the sign of the first operand.
set /p a=
set /p b=
set /a "sum=a+b, difference=a-b, product=a*b, intmod=a/b, remainder=a%%b"
echo a + b = %sum%
echo a - b = %difference%
echo a * b = %product%
echo a / b = %intmod%
echo a %%(%%^) b = %remainder%
2023-07-01 11:58:00 -04:00
pause