This Is a Certified Answer

Certified answers contain reliable, trustworthy information vouched for by a hand-picked team of experts. Brainly has millions of high quality answers, all of them carefully moderated by our most trusted community members, but certified answers are the finest of the finest.
Let the number of students in the class = x

Each gets 7 chocolates when these chocolates are distributed equally among the students of a class.
So the number of chocolates = 7 × x = 7x

If there were 5 more students in the class, then each would get 1 chocolate less.
number of students would be x+5
each will be getting = 7-1 = 6 chocolates
So number of chocolates = (x+5) × 6 = 6x+30

Since the number of chocolates is both 7x and 6x+30,
7x = 6x+30
⇒ 7x - 6x = 30
⇒ x = 30

Thus number of students is 30.