Sitting at the computer for long hours, uncomfortable chairs, bad postures, even stress can all lead to pain in your shoulder and neck. You have not mentioned how long you have been suffering from this pain. If your pain has been constant for some time it is time you visited a doctor. Pain of any kind and especially pain of the neck and shoulders, can be treated at home. However if it continues for some time, it is always a good idea to get an expert's opinion and see a doctor.
Resting the muscles of your neck and shoulders will certainly ease the pain. Lie down on a flat surface. If possible avoid using a pillow. An ice pack effectively dulls the pain in your affected muscles. Simply pack some ice in a towel and hold against the affected area. Heat is another effective way of increasing circulation and relaxing tense muscles. A hot shower can work wonders on the pain. Another option is using a moderately hot water bottle. In addition to these, you should also practice some yoga or meditation techniques since these will help you relax. If you happen to be overweight then you can try losing weight. Often excess weight can lead to various problems. Ensure that you adopt a good posture while working. Also, ensure that you take frequent breaks when at work and practice some techniques to relax your muscles during this time.
answered by G M