# Interview Questions

## 77. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 7 8 9 10 11 12 struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }```

## 76. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }```

## 74. Predict the output or error(s) of the following c code

```1 2 3 4 5 main() { int i=5,j=6,z; printf("%d",i+++j); }```

## 73. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 7 #include "stdio.h" main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }```

## 72. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 7 8 9 #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); }```

## 71. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 7 8 #include "stdio.h" main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }```

## 70. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }```

## 69. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 7 8 9 main() { int *j; { int i=10; j=&i; } printf("%d",*j); }```

## 68. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 7 8 9 10 11 12 13 14 int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }```

## 67. Predict the output or error(s) of the following c code

```1 2 3 4 5 6 7 8 9 #define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }```