What was the highest rank john glenn achieved in the military?

He Joined the Air Force as a cadet. All men know that to be a pilot in the U.S Air Force you have to be an Officer.