The correct option is D Both the charge and the size of the ions
The lattice energy for an ionic compound is directly proportional to the product of the charges of the cation and the anion and inversely proportional to the size of the ions or interionic distance (i.e. distance between centres of cation and anion) between them.
Hence, it depends on both the charge and the size of ions.