Passing arguments by pass-by-reference to a swap function
I encountered this problem while solving a practice test

Consider the following code written in a pass-by-reference language like
FORTRAN and these statements about the code

subroutine swap(ix,iy)

it = ix

L1 : ix = iy

L2 : iy = it

end

ia = 3

ib = 8

call swap (ia, ib+5)

print *, ia, ib

end


S1: The compiler will generate code to allocate a temporary nameless cell,
initialize it to 13, and pass the address of the cell swap

S2: On execution the code will generate a runtime error on line L1

S3: On execution the code will generate a runtime error on line L2

S4: The program will print 13 and 8

S5: The program will print 13 and -2

Which of the above the above statement(s) is/are correct.

I think S1 and S4. Could anyone please confirm? TIA
Passing arguments by pass-by-reference to a swap function
===

I encountered this problem while solving a practice test

Consider the following code written in a pass-by-reference language like
FORTRAN and these statements about the code

subroutine swap(ix,iy)

it = ix

L1 : ix = iy

L2 : iy = it

end

ia = 3

ib = 8

call swap (ia, ib+5)

print *, ia, ib

end


S1: The compiler will generate code to allocate a temporary nameless cell,
initialize it to 13, and pass the address of the cell swap

S2: On execution the code will generate a runtime error on line L1

S3: On execution the code will generate a runtime error on line L2

S4: The program will print 13 and 8

S5: The program will print 13 and -2

Which of the above the above statement(s) is/are correct.

I think S1 and S4. Could anyone please confirm? TIA