http://www.strath.ac.uk/IT/Docs/Ccourse/ would be your best bet for info on C.
as far as the program goes try something like this for the main function of your program.
main()
{
//declare your variables and get the number from user
if(num >=0 && num <=999)
{
//your code here
}
else
exit(0);
}