(a) Any member of the armed forces who--
(1) without authority goes or remains absent from his unit, organization, or place of duty with intent to remain away therefrom permanently;
(2) quits his unit, organization, or place of duty with intent to avoid hazardous duty or to shirk important service; or
(3) without being regularly separated from one of the armed forces enlists or accepts an appointment in the same or another one of the armed forces without fully disclosing the fact that he has not been regularly separated, or enters any foreign armed service except when authorized by the United States;
is guilty of desertion.
(b) Any commissioned officer of the armed forces who, after tender of his resignation and before notice of its acceptance, quits his post or proper duties without leave and with intent to remain away therefrom permanently is guilty of desertion.
(c) Any person found guilty of desertion or attempt to desert shall be punished, if the offense is committed in time of war, by death or such other punishment as a court-martial may direct, but if the desertion or attempt to desert occurs at any other time, by such punishment, other than death, as a court-martial may direct.