The general form of a compound can be written in the form of:
[X(a) Y(b)] ^ c
Where a and b are subscripts, and c is the superscript of the whole formula.
The relationship that we can derived here between the constants is:
(valence of X) * a + (valence of Y) * b = c
Since the formula obviously has no superscript, therefore c = 0. We also know in chemistry class that the valence of Cl is -1, therefore:
valence of X * 1 + (-1) * 3 = 0
valence of X - 3 = 0
valence of X = 3