main( )

{

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

printf(“%u %u %u %d \n”,a,*a,**a,***a);

printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1);

}

Answers were Sorted based on User's Feedback



main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(..

Answer / surya

100 100 100 2
124 108 104 3

Is This Answer Correct ?    21 Yes 8 No

main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(..

Answer / susie

Answer :

100, 100, 100, 2

114, 104, 102, 3

Explanation:

The given array is a 3-D one. It can also be viewed as a
1-D array.

2
4
7
8
3
4
2
2
2
3
3
4
100 102 104 106 108 110 112 114 116 118
120 122

thus, for the first printf statement a, *a, **a give
address of first element . since the indirection ***a gives
the value. Hence, the first line of the output.

for the second printf a+1 increases in the third dimension
thus points to value at 114, *a+1 increments in second
dimension thus points to 104, **a +1 increments the first
dimension thus points to 102 and ***a+1 first gets the value
at first location and then increments it by 1. Hence, the
output.

Is This Answer Correct ?    11 Yes 16 No

Post New Answer

More C Code Interview Questions

Write a program that reads a dynamic array of 40 integers and displays only even integers

2 Answers  


plz tell me the solution.......... in c language program guess any one number from 1 to 50 and tell that number within 8 asking question in yes or no...............

2 Answers   Wipro,


void ( * abc( int, void ( *def) () ) ) ();

1 Answers  


Cluster head selection in Wireless Sensor Network using C programming language.

0 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() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }

3 Answers  


To reverse an entire text file into another text file.... get d file names in cmd line

0 Answers   Subex,


main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 Answers  


What is full form of PEPSI

0 Answers  


main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }

1 Answers   CSC,


why is printf("%d %d %d",i++,--i,i--);

4 Answers   Apple, Cynity, TCS,


main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,


Categories