As Thiago has explained this program is invalid.
If you want to know what is behind the scene then it seems the addresses of the character array and integer object coincide.
So when the value (for example "a") of the array was entered it overwrote the value that was entered for n1 in the preceeding step..
Thus at the common address of this two objects there is the same value
96, 0
Then it is outputed at first as a character array and you see character 'a' and then it is outputed as an integer and you see 96.
If you will change the order of definitions of the objects then the objects do not overlape. Nevertheles the program has undefined behaviour because the data that are entered in the character array overwrite some other memory.