Answer
James Madison was the president when Elbridge Gerry served as vice president. Gerry's tenure as vice president spanned from 1813 to 1814, during Madison's second term in office. Madison, the fourth president of the United States, is known for his role in drafting the Constitution and his leadership during the War of 1812.