I'm assuming you mean static shocks, because if you really do mean electrical shocks, it's time to unplug the computer immediately and get a new one. It's now a fire hazard.
If it's simply a static shock, it's nothing to worry about. There are a lot of things that can cause a buildup of static electricity. New carpet, new shoes, dry climate, certain items of clothing like wool sweaters, the list goes on. You're not going to harm anything inside the computer if you're just getting a static shock when you touch the case. The case of the computer acts like the frame of a car would if hit by lightning. The charge is spread out across the case of the computer, but the insides are unaffected.
So you need to figure out if this is an electric shock or a static shock, because the two are very different and have very different consequences. To help you out, an electric shock, given the kind of current running through a computer, will likely hurt quite a bit. Might even cause some burning or skin inflamtion/irritation. Static shocks can be painful, but at most you're looking at a numb finger or hand for a few minutes.
I have compaq AMD Athlon based machine.It is 3-4 years old.Recently I have been getting electric shock on the CPU body. Kindly help me.