Mid 2011 and newer iMacs have got Thunderbolt instead of Mini DisplayPort. Thunderbolt can be used for audio, video and data, so you can connect displays to the computer by using a Mini DisplayPort adapter, because Mini DisplayPort and Thunderbolt use the same port. In other words, Thunderbolt is the same as Mini DisplayPort but with the ability to transfer data to an external drive.
If you want to connect a display, see the ports it has got and buy a Mini DisplayPort adapter and a cable for it. Then, connect the iMac and the display, and image will show automatically on the external screen. See > http://support.apple.com/kb/HT5019