IPhone 5 keeps restarting by itself
Please Help! My iPhone 5 has no issue or anything, dropped it a few times but it still works perfectly fine. The day before yesterday, i was using my phone, then randomly, it restarted by itself, so the apple logo showed up, i thought it was normal but i have waited for 2 hours! Then some error with numbers showed up with the apple logo, i was freaking out, i didn't know what to do, then it turned off, black screen, then i used my charger to turn it on (cause my power button doesn't work) so it was lowbatt and the red battery showed up in the screen, then after a few minutes, the apple logo showed up again, for 2 hours I've waited, then again, the error showed up, then finally it came back again, i could use it again, then after 30 minutes, it restarted by itself, AGAIN. This keeps on happening. I don't really know what to do. Please help me. I don't know if the battery of the phone has a problem? Or something inside the phone needs to be replaced? What should i do?