Why does my iphone 5c keep turning off and on by itself?

Why does my iphone 5c keep turning off and on by itself?

Because it's five or six years old and smartphones usually don't last that long.

It is old so it probably is going bad

Take it to the apple store

Force Restart. If your iPhone or iPad keeps shutting down, won't charge, or keeps crashing, it might be time for a hard reset. Whether it's really shutting down on its own, or it's rapidly depleting the battery due to rogue processes or Wi-Fi or cellular radio activity, a hard reset can help.

Bad battery making that happen? Just a guess.

Maybe thee battery is getting old

Because it's OLD!

Battery failure.

Button stuck.

Firmware corrupted.

Electronics going bad.

It's aging bro; you just have to let it go