C examples for String:String Console Input
To read and print a character array use the %s conversion specifier.
#include <stdio.h> int main()//from ww w . j a va2 s. co m { char color[12] = {'\0'}; printf("Enter your favorite color: "); scanf("%s", color); printf("\nYou entered: %s", color); }