B. To reduce the risk of cracking
The main purpose of preheating in welding is to reduce the risk of cracking in the welded joints, particularly in materials that are susceptible to cracking due to thermal stresses or when welding high-carbon steels and other alloys. Preheating helps to minimize the temperature gradient and allows for better control of the cooling rate, which reduces the chances of brittle fracture.