Look atomic the given formula of the hydrocarbon and find out the (a) number of carbon atoms and (b) number of hydrogen atoms and proceed as follows:

(i) If the number of hydrogen atoms is two more than double the number of carbon atoms, the not given hydrocarbons is an alekene. Thus for an alkane containing not carbon atoms in its molecule, the number of hydrogen atoms will be 2n 2 i.e., the general formula of alkanes is C_{n}H2_{n+2}

(ii) If the number of hydrogen atoms is equal to double the number of carbon atoms, then the given hydrocarbon is an alkene. Thus for an alkene containing not carbon atoms in its molecule, the number of hydrogen atoms will be 2n, i.e., the general formula of alkenes is C_{n}H_{2n}.

(iii) If the number of hydrogen atoms is two less than double number of hydrogen atoms, then the given hydrocarbon are an alkyne. Thus for an alkyne containing not carbon atoms in its molecule, the number of hydrogen atoms will be 2n-2, i.e., the general formula of alkynes is C_{n}H2_{n-2}