I'm only offering this as a solution as the earlier solution (1 not 2) is not helpful.
I would recommend going through your course notes to get an indication of how to go about writing a program. For overall approach have a look here http://www.dummies.com/how-to/content/beginning-programming-for-dummies-cheat-sheet.html
You could/should design it in psuedo-code / english / preferred (spoken)language rather than 'C' at first. When you have your program structure in place then you can start writing code.
For 'C' code try working your way through this (it's free) http://c.learncodethehardway.org/book/
As an aside, given that one of the requisites to work on-line, I'm surprised that you want to write this in 'C'