The statement int num[2][3]={ {3,8,6}, {9,4,7}};

28 views
  • assigns a value 4 to num[1][2]
  • assigns a value 7 to num[1][2] (Correct Answer)
  • assigns a value 8 to num[1][2]
  • assigns a value 9 to num[1][2]

Explanation

The statement int num[2][3]={ {3,8,6}, {9,4,7}}; assigns a value of 7 to num[1][2].

Here, num is a two-dimensional integer array with two rows and three columns. The values inside the curly braces represent the values to be assigned to the elements of the array in row-major order.

So, the values assigned to the elements of the array are as follows:

num[0][0] = 3
num[0][1] = 8
num[0][2] = 6
num[1][0] = 9
num[1][1] = 4
num[1][2] = 7
Therefore, num[1][2] has a value of 7.

Comments (0)

No comments yet. Be the first to comment!

Want to practice more?

Explore thousands of MCQs across every exam category on Exams Nepal.

Find More MCQs