This Bible contradiction is from the Skeptic's Annotated Bible.
Seven years of famine
2 Samuel 24:13 View context
So Gad came to David, and told him, and said unto him, Shall seven years of famine come unto thee in thy land? or wilt thou flee three months before thine enemies, while they pursue thee? or that there be three days' pestilence in thy land? now advise, and see what answer I shall return to him that sent me.
Three years of famine
1 Chronicles 21:11-12 View context
So Gad came to David, and said unto him, Thus saith the LORD, Choose thee
Either three years' famine; or three months to be destroyed before thy foes, while that the sword of thine enemies overtaketh [thee]; or else three days the sword of the LORD, even the pestilence, in the land, and the angel of the LORD destroying throughout all the coasts of Israel. Now therefore advise thyself what word I shall bring again to him that sent me.