718 views
0 votes
0 votes

Consider the following program:

main (){
    int i, j;
    int A[p][q] = { {1, 3, 5}, {2, 4, 6} };
    for (i = 0; i < m; i++)
        for (j = 0; j < n; j++)
            printf("%d", * (A[j] + i));
}

Assume $m$ is number of rows and $n$ is number of columns.

Find the OUTPUT printed by the above program.

  1. $123456$
  2. $135246$
  3. $456456$
  4. $456789$

Please log in or register to answer this question.

Related questions

13 votes
13 votes
8 answers
1
Na462 asked Aug 22, 2018
5,589 views
Consider a 2 dimensional array A[40...95,40...95] in lower triangular matrix representation. The size of each element of array is 1 Byte.If array is implemented in memory...
1 votes
1 votes
1 answer
2
amitarp818 asked Oct 25, 2023
426 views
How is the address written for 3-dimensional arrays?In some answers, I saw (row, column, frame) and in others, it was (frame, row, column) Which one to follow??Also, how ...
0 votes
0 votes
1 answer
3
Debargha Mitra Roy asked Apr 16
74 views
#include <stdio.h int main() { int a[3] = {1, 3, 5, 7, 9, 11}; int *ptr = a[0]; ptr += sizeof(int); printf("%d", *ptr); return 0; }(Assume size of int to be $2$ bytes.)T...
2 votes
2 votes
1 answer
4