The cable style will depend on which iMac the OP has . . . remember that there are G3, G4, G5 and then intel iMacs, each using a different VGA/DVI cable connector.
According to the 365/24/7 available Apple - Mac website, that features full specifications for past and current products, along with easy to access links to features, tips, accessories and scads of other information about the iMac . . .
Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.