• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | GATE CS Mock 2018 | Set 2 | Question 38

Consider a 2D-array A[10][20] using row major order in memory and the memory location we want to access is A[y, z]. Known that each memory address occupies 4-bytes. Below is the 3-address code for the same, fill the blank spaces with correct value :
x : A[y, z]

t1 = ---(1)--- * ---(2)---
t2 = t1  +  z
t3 = t2  *  ---(3)---
---(4)--- = base address of A
x = t4[---(5)---]

(A)

(1) : x (2) : 10 (3) : 4 (4) : t4 (5) : t3

(B)

(1) : y (2) : 10 (3) : t4 (4) : 4 (5) : t3

(C)

(1) : y (2) : 20 (3) : 4 (4) : t4 (5) : t3

(D)

None of these

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments