He was elected president in 1840 , and died of pneumonia in April 1841 , a month after taking office .
He was elected president in 1840 , and took the oath of office on March 4 , 1841 .