Herbert Hoover was a mining engineer for a while. This is a rather unfortunate example.
I can't remember any names, but I know other countries have a had a better go of it. Specifically I'm thinking of an Eastern Asian country but I really can't remember who and what country.
Seriously though, it'd be interesting to have any kind of programmer / engineer / etc as President. Have we ever had that?