C Language Features Interview Questions

Given the following C code:

struct department {
 char name[20];
 int id;
};

struct department d;

add a typedef to allow easy declaration of departments and add some code that uses the typedef.

Explain what the following code does:

#include <stdio.h>

int main()
{
   int i;
   int *p;

   i = 2;
   p = &i;

   *p = 3;      

   printf("%d\n", i);

   return 0;
}