Question: Write and memory trace an algorithm that accepts two integers as inputs and outputs an appro- priate message if one of the integers is a
Write and memory trace an algorithm that accepts two integers as inputs and outputs an appro- priate message if one of the integers is a divisor of the other one and a different message if neither number is divisible by the other. Here, divisor means that the remainder is 0 when the numbers are divided. Memory trace your algorithm using the two pairs of numbers: (5, 24) and (30, 10). Keep in mind that the first input integer can be either the smaller or the larger one of the two numbers. Only basic math operations and algorithm statements can appear in your algorithm; no Matlab built-in functions are allowed.
Step by Step Solution
3.37 Rating (150 Votes )
There are 3 Steps involved in it
Algorithm with Memory Trace Explanation Lets create an algorithm to determine if one of the two inpu... View full answer
Get step-by-step solutions from verified subject matter experts
