retagged by
304 views
1 votes
1 votes

Consider the below code snippet:

#include<stdio.h>
int main()
{
    int p[15][20][29] = {0};
    p[4][2][3] = 6;
    ---------------
    return 0;
}

Which of the following options will print $6$ when added in the missing part of the above code?

  1. printf("%d",*(*(*(p+4)+2)+3));
  2. printf("%d",***((p+4)+2)+3);
  3. printf("%d",*(*((p+4)+2)+3));
  4. printf("%d",*(((p+4)+2)+3));
retagged by

1 Answer

1 votes
1 votes
$a[i] = *(a+i).$

So,

$p[4] = *(p+4)$
$p[4][2] = *(*(p+4)+2)$
$p[4][2][3] = *(*(*(p+4)+2)+3).$
Answer:

Related questions

3 votes
3 votes
1 answer
2
Bikram asked May 14, 2017
266 views
Consider the below $C$ code:#include<stdio.h int main() { char a[] = "gateoverflow"; char *p = a; printf("%s", p+p[3]-p ); }The output will be : gate eoverflow overflo...
5 votes
5 votes
1 answer
3
3 votes
3 votes
3 answers
4
Bikram asked May 14, 2017
470 views
A student reaches school 15 minutes early by running at a speed of 5 km/h from his house. By walking at 3 km/h, he is late by 9 minutes. The distance between the school a...