main()

{

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

int i,j;

static *p[]={a,a+1,a+2};

for(i=0;i<3;i++)

{

for(j=0;j<3;j++)

printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j),

*(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i));

}

}



main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; sta..

Answer / susie

Answer :

1 1 1 1

2 4 2 4

3 7 3 7

4 2 4 2

5 5 5 5

6 8 6 8

7 3 7 3

8 6 8 6

9 9 9 9

Explanation:

*(*(p+i)+j) is equivalent to p[i][j].

Is This Answer Correct ?    11 Yes 1 No

Post New Answer

More C Code Interview Questions

void main() { unsigned giveit=-1; int gotit; printf("%u ",++giveit); printf("%u \n",gotit=--giveit); }

1 Answers  


void main() { int i=i++,j=j++,k=k++; printf(ā€œ%d%d%dā€,i,j,k); }

1 Answers  


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

3 Answers  


main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }

1 Answers  


void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }

2 Answers  






main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }

1 Answers  


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }

3 Answers   Wipro,


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,


Write a Program in 'C' To Insert a Unique Number Only. (Hint: Just Like a Primary Key Numbers In Database.) Please Some One Suggest Me a Better Solution for This question ??

0 Answers   Home,


abcdedcba abc cba ab ba a a

2 Answers  


union u { struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i; }u; main() { u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l); } a. 4, 4, 0 b. 0, 0, 0 c. 100, 4, 0 d. 40, 4, 0

1 Answers   HCL,


Categories