Everyone seems to like generating and rendering terrain. I got lots of email about my old fractal program as well as the article I wrote a couple years ago. The fractal program used the Mandlebrot set to generate the height data, so it had pretty limited usefullness. The algorithm used in this article and program is much more flexible and can generate very realistic and usable terrain.
The code in this project is all from the final project in my CSCI580 class I took Fall 1999. The project was on generating ecosystems, but this article only deals with generating terrain. The executable for the entire project is linked at the bottom of this page.
Before you go any further, go read my article on Procedural Textures if you haven't already, or if you aren't familiar with that term.