C Programming - Pointers - Discussion

Discussion Forum : Pointers - Find Output of Program (Q.No. 18)
18.
What will be the output of the program assuming that the array begins at location 1002?
#include<stdio.h>

int main()
{
    int a[2][3][4] = { {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2}, 
                       {2, 1, 4, 7, 6, 7, 8, 9, 0, 0, 0, 0} };
    printf("%u, %u, %u, %d\n", a, *a, **a, ***a);
    return 0;
}
1002, 2004, 4008, 2
2004, 4008, 8016, 1
1002, 1002, 1002, 1
Error
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
54 comments Page 5 of 6.

Payal said:   8 years ago
Why ***a=1?

Please explain it.

Pattu said:   7 years ago
Thanks for the answer @Shriram.

Hari said:   1 decade ago
Thanks chetan done a nice job.

Karthik said:   1 decade ago
@Shailesh thank you very much.

Ashu said:   8 years ago
Why ***a=1? Please explain it.

Student said:   9 years ago
@Chetan.

Good job, Thank you.

Anjaliraj said:   6 years ago
Thanks for the answer @Sriram.

Biswajit said:   1 decade ago
Thanks sriram. Nice explation

GURU said:   1 decade ago
I need some more explanation.

Karthik said:   1 decade ago
@Chetan thank you very much.


Post your comments here:

Your comments will be displayed after verification.