How to resolve the algorithm Arithmetic/Integer step by step in the NetRexx programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Arithmetic/Integer step by step in the NetRexx programming language
Table of Contents
Problem Statement
Get two integers from the user, and then (for those two integers), display their:
Don't include error handling. For quotient, indicate how it rounds (e.g. towards zero, towards negative infinity, etc.). For remainder, indicate whether its sign matches the sign of the first operand or of the second operand, if they are different.
Bonus: Include an example of the integer divmod
operator. For example: as in #Haskell, #Python and #ALGOL 68
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Arithmetic/Integer step by step in the NetRexx programming language
Source code in the netrexx programming language
/* NetRexx */
options replace format comments java crossref symbols binary
say "enter 2 integer values separated by blanks"
parse ask a b
say a "+" b "=" a + b
say a "-" b "=" a - b
say a "*" b "=" a * b
say a "/" b "=" a % b "remaining" a // b "(sign from first operand)"
say a "^" b "=" a ** b
return
You may also check:How to resolve the algorithm Bioinformatics/Sequence mutation step by step in the Ada programming language
You may also check:How to resolve the algorithm Brace expansion step by step in the Simula programming language
You may also check:How to resolve the algorithm Largest number divisible by its digits step by step in the Python programming language
You may also check:How to resolve the algorithm Formal power series step by step in the PARI/GP programming language
You may also check:How to resolve the algorithm Loops/Infinite step by step in the Scala programming language