My iPhone 5 keeps turning off randomly?

I have an iPhone 5 as it says, but I've been having some trouble with it recently, it keeps turning off randomly, when it has at least 40% battery, and it won't turn back on if I hold down the sleep button, it sometimes but only rarely turns back on when I hold down the sleep button and the home button for ten seconds, but 90% of the time I have to plug it into the charger or wait about half an hour for it to turn back on, has anyone else had this problem? It just started randomly, I haven't dropped it or gotten it wet or anything, I only got it in January, thank you In advance.

Probably just a glitch from apple, try taking it to an apple store or call apple about it

Not much I can say other than you should have gotten a galaxy s4…

Happens to me too. No cure yet

Yeah this is the exact problem that im having with my iphone right now i asked help on their technical support on their website and suggested to update my o.s. Since mine is outdated, i just updated to the latest os. Hopefully if fixes the problem if dont i gotta bring it to apple

Same problem. When you take it to an apple store they tell you to wipe all your data!

Have had this problem several times during the past year - apparently it's a glitch with the 5. Happened today with it showed 83% charge. First time it's happened when I had more then 50% charge. Not upgraded to IOS 7 - did not see anything in the materials about it addressing this problem.