#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);

}



#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,..

Answer / susie

Answer :

garbagevalue..1

Explanation:

p=&a[2][2][2] you declare only two 2D arrays. but you are
trying to access the third 2D(which you are not declared) it
will print garbage values. *q=***a starting address of a is
assigned integer pointer. now q is pointing to starting
address of a.if you print *q meAnswer:it will print first
element of 3D array.

Is This Answer Correct ?    9 Yes 1 No

Post New Answer

More C Code Interview Questions

How we print the table of 2 using for loop in c programing?

14 Answers   HCL, Wipro,


#define a 10 int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } void foo() { #undef a #define a 50 }

3 Answers  


Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange

0 Answers  


How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com

11 Answers   Deshaw, Infosys,


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

2 Answers   CSS, Wipro,






Is the following code legal? struct a { int x; struct a *b; }

2 Answers  


Write a routine that prints out a 2-D array in spiral order

3 Answers   Microsoft,


void main() { if(~0 == (unsigned int)-1) printf(“You can answer this if you know how values are represented in memory”); }

1 Answers  


Write a C function to search a number in the given list of numbers. donot use printf and scanf

5 Answers   Honeywell, TCS,


main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

1 Answers  


respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"

1 Answers   Genpact, Ozdocs,


how can i cast a char type array to an int type array

2 Answers  


Categories