C Programming - Pointers

11.
What will be the output of the program?
#include<stdio.h>

int main()
{
    int arr[2][2][2] = {10, 2, 3, 4, 5, 6, 7, 8};
    int *p, *q;
    p = &arr[1][1][1];
    q = (int*) arr;
    printf("%d, %d\n", *p, *q);
    return 0;
}
8, 10
10, 2
8, 1
Garbage values
Answer: Option
Explanation:
No answer description is available. Let's discuss.

12.
What will be the output of the program assuming that the array begins at the location 1002 and size of an integer is 4 bytes?
#include<stdio.h>

int main()
{
    int a[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
    printf("%u, %u, %u\n", a[0]+1, *(a[0]+1), *(*(a+0)+1));
    return 0;
}
448, 4, 4
520, 2, 2
1006, 2, 2
Error
Answer: Option
Explanation:
No answer description is available. Let's discuss.

13.
What will be the output of the program?
#include<stdio.h>

int main()
{
    int arr[3] = {2, 3, 4};
    char *p;
    p = arr;
    p = (char*)((int*)(p));
    printf("%d, ", *p);
    p = (int*)(p+1);
    printf("%d", *p);
    return 0;
}
2, 3
2, 0
2, Garbage value
0, 0
Answer: Option
Explanation:
No answer description is available. Let's discuss.

14.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    char *str;
    str = "%d\n";
    str++;
    str++;
    printf(str-2, 300);
    return 0;
}
No output
30
3
300
Answer: Option
Explanation:
No answer description is available. Let's discuss.

15.
What will be the output of the program ?
#include<stdio.h>

int main()
{
    printf("%c\n", 7["IndiaBIX"]);
    return 0;
}
Error: in printf
Nothing will print
print "X" of IndiaBIX
print "7"
Answer: Option
Explanation:
No answer description is available. Let's discuss.