What presidents had the highest military ranks?

George Washington, Andrew Jackson, William Henry Harrison, Zachary Taylor, Ulysses S. Grant, Rutherford B. Hayes, and Dwight D. Eisenhower all attained the rank of general before becoming President of the US. Other US presidents held lesser military ranks.