Consider Quran 4:15, which calls for punishment of lifetime confinement for women found guilty of adultery: "Those who commit unlawful sexual intercourse of your women - bring against them four [witnesses] from among you. And if they testify, confine the guilty women to houses until death takes them or Allah ordains for them [another] way." Yet Quran 24:2 demands instead that those committing adultery be flogged 100 times: "The adulterer and the adulteress, scourge each one of them (with) a hundred stripes. And let not pity for the two withhold you from obedience to Allah, if you believe in Allah and the Last Day. And let a party of believers witness their punishment."
Now some Muslims assert that Quran 24:2 is meant to apply to unmarried adulterers and adulteresses, though the word "unmarried" is not found in the verse. But even if this is the case, then verses 24:2 still abrogates Quran 4:15 insofar as the penalty it prescribes for unmarried female adulteresses of lifetime confinement is now replaced by flogging. Repeatedly, some -- though not all -- Muslims have argued that Quran 4:15 is in fact abrogated by Quran 24:2. Here for example we read that "Flogging replaced the confinement till death" (a recommended essay). Abdullah Yusuf Ali wrote in The Holy Qur’an: Translation and Commentary, (p. 183) that Quran 24:2 abrogates Quran 4:15. A scholarly article here further asserts that Quran 24:2 abrogates Quran 4:15.
What is most striking here is that Muhammad himself did not obey Quran 4:15!!! Let us read Sahih Muslim, 17:14209: "Abu Huraira and Zaid b Khalid al-Juhani reported that one of the desert tribes came to Allah's Messenger (may peace be upon him) and said: Messenger of Allah, I beg of you in the name of Allah that you pronounce judgment about me according to the Book of Allah. The second claimant who was wiser than him said: Well, decide amongst us according to the Book of Allah, but permit me (to say something). Thereupon Allah's Messenger (may peace be upon him) said: Say. He said: My son was a servant in the house of this person and he committed adultery with his wife. I was informed that my son deserved stoning to death (as punishment for this offence). I gave one hundred goats and a slave girl as ransom for this. I asked the scholars (if this could serve as an expiation for this offence). They informed me that my son deserved one hundred lashes and exile for one year. and this woman deserved stoning (as she was married). Thereupon Allah's Messenger (may peace he upon him) said: By Him in Whose Hand is my life. I will decide between you according to the Book of Allah. The slave-girl and the goats should be given back, and your son is to be punished with one hundred lashes and exile for one year. And, O Unais (b. Zuhaq al-Aslami), go to this woman in the morning, and if she makes a confession, then stone her. He (the narrator) said: He went to her in the morning and she made a confession. And Allah's Messenger (may peace be upon him) made pronouncement about her and she was stoned to death."
Nowhere in the Quran does it state that the death penalty should be applied to adulterers. So instead of demanding the applicable punishment actually found in the Quran, namely, lifetime house arrest, Muhammad wanted the death penalty for the adulterous woman. Now it could be that Muhammad thought that Quran 4:15 was abrogated by Quran 24:2, but then he didn't even demand that the adulterous woman be flogged 100 times -- instead he wanted the death penalty! Tellingly, both Iran (until very recently) and Saudi Arabia (Woman to be stoned to death for adultery in Saudi Arabia) would rather be guided by Muhammad's actions in determining the punishment for the married female adulteress, than by the Quran itself!