Question discussion

Consider the statement.int val[2][4] = {1, 2, 3, 4, 5, 6, 7, 8};4 will be the value of

2871Medium DSSSB TGT Computer Science 0 replies 2 views
0

Consider the statement.

int val[2][4] = {1, 2, 3, 4, 5, 6, 7, 8};

4 will be the value of

  • Aval[1][4]
  • Bval[1][1]
  • Cval[0][4]
  • Dnone of these
Correct answer: D

Explanation

The array is filled row-wise: val[0] = {1,2,3,4}, val[1] = {5,6,7,8}. The value 4 is val[0][3], which is not among the options.

Discussion 0

Nobody has replied yet. Start the discussion!