Which U.S. President was the last to have served in the military during the American Civil War?

History Trivia Question: Which U.S. President was the last to have served in the military during the American Civil War?