Consider the following pseudo-code. 𝐿1: 𝑑1 = βˆ’1 𝐿2: 𝑑2 = 0 𝐿3: 𝑑3 = 0…

GATE Β· 2024 Β· CS Β· Set 1 Β· Computer Science & IT

Consider the following pseudo-code.

Β  Β  Β  Β  𝐿1: 𝑑1 = βˆ’1

Β  Β  Β  Β  𝐿2: 𝑑2 = 0

Β  Β  Β  Β  𝐿3: 𝑑3 = 0

Β  Β  Β  Β  𝐿4: 𝑑4 = 4 βˆ— 𝑑3

Β  Β  Β  Β  𝐿5: 𝑑5 = 4 βˆ— 𝑑2

Β  Β  Β  Β  𝐿6: 𝑑6 = 𝑑5 βˆ— 𝑀

Β  Β  Β  Β  𝐿7: 𝑑7 = 𝑑4 + 𝑑6

Β  Β  Β  Β  𝐿8: 𝑑8 = π‘Ž[𝑑7]

Β  Β  Β  Β  𝐿9: if 𝑑8 <= π‘šπ‘Žπ‘₯ goto 𝐿11

Β  Β  Β  Β  𝐿10: 𝑑1 = 𝑑8

Β  Β  Β  Β  𝐿11: 𝑑3 = 𝑑3 + 1

Β  Β  Β  Β  𝐿12: if 𝑑3 < 𝑀 goto 𝐿4

Β  Β  Β  Β  𝐿13: 𝑑2 = 𝑑2 + 1

Β  Β  Β  Β  𝐿14: if 𝑑2 < 𝑁 goto 𝐿3

Β  Β  Β  Β  𝐿15: π‘šπ‘Žπ‘₯ = 𝑑1

Which one of the following options CORRECTLY specifies the number of basic

blocks and the number of instructions in the largest basic block, respectively ?

  1. A.

    6 and 6

  2. B.

    6 and 7

  3. C.

    7 and 7

  4. D.

    7 and 6

Attempted by 192 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…