edited by
392 views
1 votes
1 votes

What does the following program print?

int data[3][4] = {{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}};
int main(void)
{
    int r, c;
    for(r = 0; r < 3; r++)
        for(c = 0; c < 4; c++)
            if(r != c)
                printf("%3d,", *(*(data + c) + r) + 10);
    return 0;
}
edited by

1 Answer

Best answer
3 votes
3 votes

please find the below screen shot for clear explanation,output is as follows:

15,   19,   randomGarbageValue+10,   12,   20,   randomGarbageValue+10,   13,   17,  randomGarbageValue+10,

edited by

Related questions

1 votes
1 votes
2 answers
2
0 votes
0 votes
1 answer
3
sushmita asked Mar 27, 2017
512 views
Find the out put of the following C program. main() { char *ptr = "techtud"; char p= (*ptr)++; printf("%s\n",ptr); }the output of the program came as$?$