imac tries boot and turns off
When I turn on my iMac, a white screen with an Apple logo appears with a rotating circle right below the logo. After a while, it fails to boot and turns off. I tried turning the computer on while pressing Command R or Shift Command R P but nothing seems to work. Pressing those buttons while turning on just makes the computer turn off sooner. Does anyone have any suggestion?
iMac (27-inch Mid 2011), OS X Mountain Lion (10.8)