In C Language, the first thing to do is to send the following command which is embedded into the first line
Content-type: text/html\n\n to stdout, then you can write any HTML code you might have. Another possibility is to use CGI, but that involves in having a CGI enabled hosting account.
Here is a good tutorial to start with: http://www.cs.tut.fi/~jkorpela/forms/cgic.html
It covers all the basics regarding HTML coding and website publishing.