There are at least two ways to look at this.
Method One :
The Zn in Zinc Cyanide belongs to valency two while the CN radical
belongs to valency one. As a result, you would need two CN radicals
to bond with the Zn to make it a stable compound. Hence the formula
being Zn(CN)₂
Method Two :
Since the mole of zinc is 4.7 mol and that of CN is 9.5 mol then that
means that there is twice as much moles of CN as there is Zinc
4.7 mol × 2 = 9. 4 mol. Thus the formula would be Zn(CN)₂