PC boots up for around 2 minutes then shuts down without warning

alex.hollowell

Prominent
Aug 23, 2017
8
0
510
My pc has been having a problem where when I boot it up, it allows me to sign in to my account but then it instantly freezes and then after around a minute it shuts down. This is often followed by, upon rebooting, a black screen appears with a changing number-letter combination in the bottom corner (c5, 99 etc) and I am currently unable to use my pc at all, any thoughts on what the problem could be caused by and how to fix it?
 

alex.hollowell

Prominent
Aug 23, 2017
8
0
510
Sorry I completely forgot about listing components:
Motherboard: MSI H61M-P31 (G3)
GPU: GTX 970
CPU: I don't know the name because it's very old
Power supply: corsair cx500
RAM: 2x some random 4gb ddr3

I'm new to the pc scene so if I have missed any components just ask, thanks including advance