Hint: Oxidation number is also termed as oxidation state of an atom. It is defined as the charge carried by an atom when forming a bond. The \[HCl\] is a hydrohalide and is an acid.
Complete step by step answer: Oxidation number of an atom is defined as the charge on an atom which appears while forming ionic bonds with other atoms. Out of the two bonded atoms the one which has higher electronegativity is assigned a negative oxidation state and the one having lower electronegativity is assigned positive oxidation state. Oxidation number or state is also referred to as the number of electrons which a molecule gains or loses from a neutral atom. The groups \[1\], \[2\] and \[3\] elements have the tendency to lose electrons and attain positive oxidation numbers and are called electropositive elements. The group\[15\], \[16\] and \[17\] elements have the tendency to gain electrons and are called electronegative elements. The oxidation number of an atom is determined by the following steps: a) The constant oxidation state of other atoms/molecules/ions which are bonded to the atom under consideration is added b) The sum of the oxidation states are put in an equation on the left hand side and the total charge of the molecule is put on the right hand side. Thus the unknown is calculated. \[HCl\] is a neutral molecule and the overall charge is zero. \[HCl\] is bounded by a single bond which involves two electrons. Of the two bonded atoms H is less electronegative than chlorine. So on ionization the ions obtained are a hydronium ion and a chloride ion. The hydronium ion carries a unit positive charge and the chloride ion carries a unit negative charge. Hence the oxidation number of \[H\] is \[ + 1\], and the oxidation number of \[Cl\] is \[ - 1\].
Note: Oxidation number is important in determining the course of reaction. The change in oxidation state of the reactants into products helps in identification of redox reactions. Oxidation number is an integer and cannot be fractional. Further it is positive, negative or zero.