int warr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12};
What will be the value of warr[2][1][0]?
Answer: Option [D]
Let us identify the arrays for each values.
warr[0][0][0]=1
warr[0][0][1]=2
warr[0][1][0]=3
warr[0][1][1]=4
warr[1][0][0]=5
warr[1][0][1]=6
warr[1][1][0]=7
warr[1][1][1]=8
warr[2][0][0]=9
warr[2][0][1]=10
warr[2][1][0]=11
int a[50]; int *pa; pa=a;
To access the 6th element of the array which of the following is incorrect?
Answer: Option [D]
int a[10]={1,2,3,4,5,6,7,8,9,10};
*p=a;
printf("\n%d:%d", p[7], p[a[7]]);
Answer: Option [C]
The first element of the array i.e. a[0] is assigned by *p=a. Therefore a[0]=1. Then p[7]=8 and p[a[7]]=p[8]=9
Hence 8:9
main()
{
int a[4]={1,5};
printf("%d",a[3]);
}
Answer: Option [A]
Given that int a[4]={1,5}
So a[2], a[3] etc. are 0
int a[10];
Answer: Option [C]
*a+0 points to the a[0] location.