Alkanes have a general formula:
CnH2n+1
CnH2n
CnH2n -2
CnH2n+2
Alkanes are saturated hydrocarbons therefore contain maximum hydrogen.Thus the general formula is CnH2n+2.
In general, alkanes