While he was an astronaut, he was also a naval aviator, test pilot, and aerospace engineer. His background in engineering and his work as a test pilot made him a highly qualified candidate for the Apollo missions.
He earned a Bachelor of Science degree in aeronautical engineering from Purdue University and a Master of Science degree in aerospace engineering from the University of Southern California.
So, while he's primarily known as an astronaut, Neil Armstrong was also a scientist in his own right!