Written below is the pseudo - code for a subroutine that exchanges the values of
ID: 3776647 • Letter: W
Question
Written below is the pseudo - code for a subroutine that exchanges the values of two variables, without the use a third " temp " variable for swapping purposes.
However the statements are out of order. Attempt to arrange the statements below into their proper order.
1. I = I – J
2. END
3. I = I + J
4. SUBROUTINE SWAP (I , J)
5. J = I – J
6. RETURN
(2) Pseudogode Function to Swap Two Values Written below is the pseudo code for a subroutine that exchanges the values of two variables, without the use a third "temp variable for swapping purposes. However the statements are out of order. Attempt to arrange the statements below into their proper order. 2. END 4. SUBROUTINE SWAP (LA J) 6. RETURNExplanation / Answer
1. I = I + J
2. J = I – J
3. SUBROUTINE SWAP (I , J)
4. I = I – J
5. END
6. RETURN
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.