check this
../code/c_cgi
in ubuntu, it is just go to /usr/lib/cgi-bin/
write the code compile it and call it in /var/www/index.html
<a href="cgi-bin/a.out">C</a>