The heat of formation is the enthalpy value of a compound when its reactants are elements in their elemental state.
a) Na(s) + 1/2Cl2(g) → NaCl(s)
ΔH formation=∑ΔH products - ∑ΔH reactants
or ΔH NaCl - (ΔH Na(s) + 1/2ΔH Cl2(g))
b) Na(s) + 1/2H2(g) + 1/2O2(g) → NaOH(s)
ΔH NaOH(s) - (ΔH Na(s) + 1/2ΔH H2(g) + 1/2ΔH O2(g))
c) 2C(s) + 3H2(g) → C2H6(g)
ΔH C2H6(g) - (2ΔH C(s) + 3ΔH H2(g))
d) 1/2N2(g) + O2(g) → NO2(g)
ΔH NO2(g) - (1/2ΔH N2(g) + ΔH O2(g))