Let the number of students in each row be x and the number of rows be y. Then total number of students = xy
\(\therefore\) By the given conditions,
(x + 4) (y – 2) = xy \(\Rightarrow\) xy + 4y - 2x - 8 = xy
\(\Rightarrow\) – 2x + 4y = 8 .......…(1)
and (x – 4) (y + 4) = xy
\(\Rightarrow\) xy – 4y + 4x – 16 = xy
\(\Rightarrow\) 4x – 4y = 16
Adding equations (1) and (2), we get
2x = 24
\(\Rightarrow\) x = 12
Putting x = 12 in equation (1), we get
–2 × 12 + 4y = 8 \(\Rightarrow\) 4y = 8 + 24 = 32 \(\Rightarrow\) y = 8
\(\therefore\)Total number of students in the class = x × y = 12 × 8 = 96