With one exception the 35th through to the 41st Presidents of the US had served in the USN or USNR (the exception is Ronald Reagan who had served in the USAAF). Here is a thumbnail sketch:

John F. Kennedy. Lieutenant, World War II. Received Navy and Marine Corps Medal and Purple Heart

Lyndon B. Johnson. Commander, World War II. Received Silver Star medal after observation mission in which aircraft he was on came under Japanese attack.

Richard Nixon. Commander, World War II. Earned two Service Stars.

Gerald Ford. Lieutenant Commander, World War II. Combat on USS Monterey, discharged in 1946.

Jimmy Carter. Lieutenant, World War II at the United States Naval Academy Sea duty and stateside service 1946–1953 during the Korean War.

George H. W. Bush, Lieutenant (Junior Grade), World War II. Distinguished Flying Cross.

More Info: en.wikipedia.org