Match each of the high level language statements given on the left hand side…

2005

Match each of the high level language statements given on the left hand side with the most natural addressing mode from those listed on the right hand side.

 1 A[1] = B[J];	     a Indirect addressing
 2 while [*A++];     b Indexed, addressing
 3 int temp = *x;    c Autoincrement 

Answer: C. (1, b), (2, c), (3, a)Correct matching: 1 -> Indexed addressing; 2 -> Autoincrement; 3 -> Indirect addressing. A[1] = B[J]; uses an array element accessed by an explicit index, so…

  1. A.

    (1, c), (2, b), (3, a)

  2. B.

    (1, a), (2, c), (3, b)

  3. C.

    (1, b), (2, c), (3, a)

  4. D.

    (1, a), (2, b), (3, c)

Attempted by 138 students.

Show answer & explanation

Correct answer: C

Correct matching: 1 -> Indexed addressing; 2 -> Autoincrement; 3 -> Indirect addressing.

  • A[1] = B[J]; uses an array element accessed by an explicit index, so the most natural mode is indexed addressing.

  • while [*A++]; dereferences pointer A and uses post-increment (A++). The pointer is incremented automatically after use, so autoincrement addressing is the best match.

  • int temp = *x; directly dereferences pointer x without modifying the pointer, so this is indirect addressing.

Final mapping: (1, Indexed), (2, Autoincrement), (3, Indirect).

Explore the full course: Isro

Loading lesson…