Let the number of F atoms be f, and the number of Cl atoms be c,
Energy required for the removal of
from 1 F atom = 
Energy required for the removal of
from f F atoms =

lly,
Energy required for the removal of
from c Cl atoms = 
Energy released on addition of
to f F atoms = 
Energy released on addition of
to c Cl atoms = 


Solve for f and c,
gives the percentage composition of Cl
gives the percentage composition of F