Here's an example of bulls & cows:
http://question.onlinegdb.com/11855/need-help-with-bulls-and-cows-program?show=11855#q11855
It's in Python, but it should give you a good idea of how the program should work.
Now it's your turn to implement it in C.
Good luck!