Question: is the president in charge of the military

Answer: Yes, A commander-in-chief is the person or body that exercises supreme operational command and control of a nation's military forces or significant elements of those forces. In the latter case, the force element is those forces within a particular region, or associated by function. As a practical term, it refers to military competencies that reside in a nation-state's executive leadership--either a head of state, a head of government, a minister of defence, a national cabinet, or some other collegial body. Often, a given country's commander-in-chief (if held by an official) need not be or have been a commissioned officer or even a veteran. In these countries this follows the principle of civilian control of the military.