If I am not mistaken, you are looking for the hangman game. There are many results on google you can test: https://www.google.com/search?q=hangman+in+c&ie=utf-8&oe=utf-8