I am trying to help someone with some math homework and have hit a stumbling block. The first one is when a problem asks what the algorithm is returning - I am not always seeing the pattern and wondered if there are set rules for determining this type of answer.
Also, I thought I had this one figured out, but I was wrong :smile:
Thank you for any help you might be able to give me.
Consider this algorithm:
Input: Two integers a and b
Output: the difference of a and b
(1) Return a-b
Find the output of the algorithm for the input a:=7 and b:=-7 Answer:
Find the output of the algorithm for the input a:=14 and b:=19 Answer:
Find the output of the algorithm for the input a:=0 and b:=4 Answer:
Also, I thought I had this one figured out, but I was wrong :smile:
Thank you for any help you might be able to give me.
Consider this algorithm:
Input: Two integers a and b
Output: the difference of a and b
(1) Return a-b
Find the output of the algorithm for the input a:=7 and b:=-7 Answer:
Find the output of the algorithm for the input a:=14 and b:=19 Answer:
Find the output of the algorithm for the input a:=0 and b:=4 Answer:
Last edited by a moderator: