How to take character input in an array in C?

Viewed 34379
char name[2];
scanf("%c",name);
printf("%c",name);

I am just starting to learn C. I'm curious about the above code, what I got from the printf output, is not the same with the character I typed in. Rather the output was some funny looking symbol. Can someone explain this to me?

4 Answers
Related