Give it a go before posting here. Or post your code if you have done so already. We don't do homework but we will help if you try to do this yourself and encounter a problem. Until then:
CProgramming.com is where you want to look, it doesn't take more than a few days of their tutorials to learn how to do this.
Cheers,
Jamey