Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Search and Apple.com will have told you you can if you have a Mac not older than 5 years.

How to depends on the iMac you have as there are adapters needed, either mini DVI to DVI or VGA, or mini Display Port to DVI or VGA.

EDIT: Didn't see the signature, but will leave the comments for future generations of non-searchers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.