Chosen Solution

why does my MacBook Air turn on only when plugged in? after itturns on with the charger attached it continues working if I remove it. If I turn it on without the charger it blacks out in the middle of booting. Once it did black out suddenly when I was working on it. Please let me know if I need to stop turning it on with the charger attached and get it checked in the service centre.

Sorry you need to get your system to Apple for warranty repair ASAP. Call them to arrange the repair.