first, we have to get moles of each HCl & HCN
moles of HCl = volume * molarity
= 0.04 L * 0.02 M = 0.0008 moles
moles of HCN = volume * molarity
= 0.2 L * 0.2 M = 0.04moles
∴Total moles = 0.04 + 0.0008 = 0.0408 moles
and the total volume = 0.04 L + 0.2 L = 0.24 L
∴the total concentration = total moles / total volume
= 0.0408 moles / 0.24 L
= 0.17 M
when we assume [H+] = X
∴ Ka = X^2 / (0.17-X)
by substitution
∴ 1 x 10^-10 = X^2 / (0.17 -X)
∴X = 4.12 x 10^-6
∴[H+] = 4.12 x 10^-6
∴PH = -㏒(4.12 x 10^-6)
= 5.4