Keep track of copied values

A stockroom display stores two tray counts named L and R. Initially, L contains 14 and R contains 9. The algorithm below uses another storage location, H. Copying a value replaces the destination's previous value and leaves the source unchanged.


A flowchart shows three copying instructions followed by reporting the two stored counts.


Complete the table with the values stored immediately after each copying instruction. Enter exact whole numbers; each count is measured in items.

Instruction just completedL (items)R (items)H (items)
Copy L into H
Copy R into L
Copy H into R

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More What Is an Algorithm? Questions: