Showing posts with label 2D arrays. Show all posts
Showing posts with label 2D arrays. Show all posts

Tuesday, 6 March 2012

Frequently Asked Questions in Technical Round at MNCs like TCS, WIPRO, INFOSYS,..etc – 13

Predict the output or error(s) for the following:


1)

#include<stdio.h>

main()

{

  int a[2][2][2] = { {10,2,3,4}, {5,6,7,8}  };


  int *p,*q;


  p=&a[2][2][2];


  *q=***a;


  printf("%d..%d",*p,*q);


}

Answer:

garbagevalue..1


Explanation: