Modal A is a confirmation.
Modal B is a "counter offer".
Modal C is a remedy.
Modal A clarifies what is happening and informs users of the consequences.
Modal B assumes users know what they're doing (leaving the form) and focuses on the option to go back to save changes.
Modal C, similar to B, assumes users know what they're doing but also offers the option to combine saving the form along with leaving the form.
Modal A is cognitively the simplest. The message conforms with the course of action. If users didn't know they were leaving the form or that leaving the form didn't save changes, this modal efficiently communicates those facts.
Modal B is cognitively more complex because its message and focus is contrary to the course of action—"Would you like to go back?". In the case of users not knowing they were leaving the form or that leaving the form doesn't save changes, they would first have to infer these facts.
Modal C has the same complexity as B for the same reason.
There's a second consideration. Is there a greater benefit to providing the solution in the modal, as in Modal C, OR to sending users back to the form. This analysis requires familiarity with the form, the task, and the users.
If there's a benefit to making the user go back to the form to save changes, then Modal A is the most straight forward.
However combining Modal A and Modal C takes advantage of Modal A's simplicity, and Modal C's remedy: