CBSE Class 9 Answered
Protons and neutrons are held together in a nucleus of an atom by the strong force. The strong force gets it name by being the strongest attractive force. It is 137 times more powerful than electromagnetic, which by the way cannot hold neutrons to protons because neutrons are not charged. It should be mentioned that the strong force only operates at EXTREMELY small distances. These distances are on the order of a 1000th millionth millionth of a meter (10 to the power of -15).
The strong force also attracts protons to protons or neutrons to neutrons. In the case of protons to protons, the strong force loses strength after the distance mentioned above and succumbs to the electromagnetic force which pushes the protons apart.As in the nuclei distance is of required order the strong force prevails and protons are held together.