Question discussion

Suppose the two dimensional array is declared as Then which of the following will not give the output ?

359054Medium DSSSB TGT Computer Science 0 replies 0 views
0
Suppose the two dimensional array is declared as Then which of the following will not give the output ?

Figure for question 150

Figure for question 150

  • AOption A
  • BOption B
  • COption C
  • DOption D
Correct answer: A

Explanation

With a[2][2] = {{1,2},{3,4}}, the element 4 is a[1][1], i.e. arr[1][1] = *(*(arr+1)+1) = *(arr[1]+1). The expression *(*(arr+1)) gives arr[1][0] = 3, so it does not print 4.

Discussion 0

Nobody has replied yet. Start the discussion!