David showed Nathan the prophet that he had repented of his sin by
Answer Details
After Nathan the prophet confronted David about his sin of adultery and murder, David confessed and repented of his sin. He showed Nathan that he had repented by confessing his sin before God and expressing his remorse. In 2 Samuel 12:13, David says to Nathan, "I have sinned against the Lord." David recognized that he had sinned not just against Uriah and Bathsheba, but against God Himself. David's sincere confession and repentance demonstrated that he was truly sorry for what he had done and was willing to turn away from his sin.