Its probably caused by the RAM, have it checked. If you can do it yourself, clean the RAM as shown in the image below:
Install it back to the computer and turn it on. If problems persist try another RAM, it may already need replacement.
In
case your computer has 2 RAMS installed, clean them both. To test if
there is a busted one, install the one then turn on the PC, if it works
shut down the PC. Then try the other one, if it works too then it just
needs some cleaning. But if not, one of them needs replacement. You can
still use your computer with 1 RAM, just don't expect the same
performance as having two RAM. Resetting the CMOS may also help you in the process.
Please reply if this has helped you. Thanks.