Question 58

Consider the following code written in a pass-by-reference language like FORTRAN.
                          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 to 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
         Exactly the following set of statement(s) is correct:


Create a FREE account and get:

  • Download Maths Shortcuts PDF
  • Get 300+ previous papers with solutions PDF
  • 500+ Online Tests for Free

cracku

Boost your Prep!

Download App