Question: who was the president when texas became a state
Answer: In 1844 , James K. Polk was elected the United States president after promising to annex Texas .