How to resolve the algorithm Arithmetic/Integer step by step in the TI-89 BASIC programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Arithmetic/Integer step by step in the TI-89 BASIC 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 TI-89 BASIC programming language

Source code in the ti-89 programming language

Local a, b
Prompt a, b
Disp "Sum: " & string(a + b)
Disp "Difference: " & string(a - b)
Disp "Product: " & string(a * b)
Disp "Integer quotient: " & string(intDiv(a, b))
Disp "Remainder: " & string(remain(a, b))

  

You may also check:How to resolve the algorithm Number names step by step in the Visual Basic programming language
You may also check:How to resolve the algorithm Cumulative standard deviation step by step in the CoffeeScript programming language
You may also check:How to resolve the algorithm Arithmetic/Complex step by step in the Lang programming language
You may also check:How to resolve the algorithm Monads/List monad step by step in the Perl programming language
You may also check:How to resolve the algorithm Anonymous recursion step by step in the WDTE programming language