Just to expand a little on that short answer:
If your iMac is a 400 MHz model, then there is a standard VGA connector under a bottom-rear panel - so, you CAN use a VGA connection. It's also a mirrored output, which means that you cannot display something different than the image on the built-in screen.
No DVI as MisterMe said.