The study aims to analyze the association between gestational diabetes mellitus (GDM) and other risk factors of cesarean delivery using machine learning (ML). The dataset used for the analysis is from the pregnancy risk assessment survey (PRAMS), considered in two scenarios, i.e., all the data is taken, and all the data of the women who developed GDM. Further, the data is developed in two groups Data-I and Data-II by considering multiparous and primiparous women details, respectively. The correlation analysis and major classification algorithms are applied to the data. It is founded that the top risk factors for the first time cesarean delivery are the age, height, weight, race of the women, presence of hypertension and gestational diabetes mellitus. The major risk factor for repeated cesarean delivery is the previous cesarean delivery. The presence of GDM is also one of the risk factors for cesarean delivery.