For class X, let the students passed in first class = a%
Then, by condition given in question
a% of 30 = 24
⇒ (a x 30) /100 = 24
∴ a = 80%
Now, for class Y let the student passed in first class = b%
Then, according to the question,
b% of 35 = 28
⇒ (b x 35)/100 = 28
∴ b = (28 x 100)/35 = 80%
Hence, both classes have equal percentage of student getting first class.