RosettaCodeData/Task/Arithmetic-Integer/OPL/arithmetic-integer.opl
2026-02-01 16:33:20 -08:00

17 lines
683 B
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

REM https://github.com/Eva-Broccoli/OPL-Rosetta-Code/blob/main/Armtintg.opl
REM While OPL has an INT() function, it is not necessary here because OPL always uses the simplest arithmetic possible for the numbers involved. If all numbers involved are integers, integer arithmetic is used.
REM For remainder, positive numbers are rounded down; negative numbers are rounded up.
PROC main:
LOCAL a%,b%
PRINT "Please enter a number:",
INPUT a%
PRINT "Please enter another number:",
INPUT b%
PRINT a%;"+";b%;"=";a%+b%
PRINT a%;"-";b%;"=";a%-b%
PRINT a%;"×";b%;"=";a%*b%
PRINT a%;"÷";b%;"=";a%/b%
PRINT a%;"%";b%;"=";a%-a%/b%*b%
PRINT a%;"^";b%;"=";a%**b%
GET
ENDP