in Programming in C retagged by
297 views
4 votes
4 votes

What will be the output of the following program?

#include <stdio.h>

int main()
{
    int a[2][2] = { {1, 2}, {3, 4} };
    int (*p)[2][2];
    p = &a;
    printf("%d", (*p)[0][1]);

    return 0;
}
  1. $1$
  2. $2$
  3. $3$
  4. $4$
in Programming in C retagged by
297 views

2 Comments

2 will be the answer because p is pointer to the array[2][2]. So simplify accordingly . :)
0
0

$ \large{\colorbox{yellow}{Detailed video solution of this question with direct time stamp}}$

All India Mock Test 4 - Solutions Part 1

0
0

Please log in or register to answer this question.

Answer:

Related questions