You should do it on your own, because that is what homeworks are for. Have you even tried to find anything with google for example - I doubt.
First of all, about the game itself: http://en.wikipedia.org/wiki/Sudoku
Secondly there are also complete solutions out there, like this one: http://www.pauls-pc-repair.com/sudoku/index.php?page=showSrc&src=solver/source/sudoku.c
But be aware: this solution might not be implemented according to the requirements you got. Since it ha it's "signature", any teacher could find it also, and than you are cut. So, my advice is to consult it, even compile it, but first of all work on it to understand the code, and than make your own implementation.