Is it a fairly new shuffle? Which model is it? This article shows the four types.
If it's a few years old, the battery could be worn out, so it does not hold a charge after you disconnect it. Also I don't understand this
But now only if i connect it to my PC then it works.
A shuffle (2nd-4th gen) connects to the computer using the headphones jack. It does not have a dock connector. How can it work when connected to your PC? You can't connect your headphones. (I don't think a 1st gen shuffle will work when connected either).
Its a 2nd to 4th generation ipod shuffle..
It connects with a headphone jack..
I meant it is recognised by itunes when connected to pc,it blinks yellow 1st then green..
syncing and all works when connected to pc..
Only when i disconnect it and switch it to listen to music,it does not..
Even if the battery is worn out,can it be repaired or should buy a new ipod??
If it's a 2nd gen iPod, it is old, so it can certainly have a wornout battery that does not hold a charge. So it is recognized by iTunes when connected (and powered), and appears to charge, but it does not hold the charge when disconnected.
If it's a 4th gen iPod, and it's been less than one year since purchase, it is still under warranty. So if the battery is the problem, you can get a replacement. You should contact Apple, either by making a reservation at a Genius Bar (if you have an Apple Store nearby), or by using the Contact Us link at the bottom right corner of this page.