I need neck exercises to fix neck pain from slouching?

Lumbar support. You may also want to try adding a good lumbar support to your chair. This will cause your pelvis to rotate forward and shoulders to move back providing a proper posture and decreasing neck pain.
Proper posture. Proper posture is needed because no amount of exercise will help stresses on the neck related to posture issues. Exercise can help. Your head weighs an average of 12 lbs. Imagine holding a 12 lb weight with your arm straight out away from your body rather than against your body for a period of time. No matter how strong that arm is, it will fatigue faster with the weight away from your body!