This line
int a[4]={'1','2','2','\0'};
tells the compiler to create an integer array of length 4 and put into it the integers from the curled braces from the right.
Characters in C are 1-byte integers, 1 is a character of 1 and it means integer value of it's ASCII code, i.e. 50. So the first element of an array gets the value of 50.
To fix you should write
int a[4]={1,2,2,0};
remember, that 0 cannot serve as an array end marker, since it is just a number.
If you suppose to get 122 output then do
char a[4]={'1','2','2','\0'};
printf("The value of a is %s",a);
since strings in C are character arrays with 0 as termination symbol.
Also you can let compiler to count values for you
char a[]={'1','2','2','\0'};