The cause of the problem has already being mentioned by Walter:
Your input is storing the ENTER or the newline character you typed at the end of the word in the variable. You just need to remove the newline at the end . Use strlen() to help find the end of the value and replace the '\n' with '\0'