(36) Let the number of rows be $x$ and the number of students in a row be $y$.
Total number of students in the class $= x \times y = xy$.
According to the first condition:
If $3$ students are extra in a row,there would be $1$ row less.
$(x - 1)(y + 3) = xy$
$xy + 3x - y - 3 = xy$
$3x - y = 3$ $...(i)$
According to the second condition:
If $3$ students are less in a row,there would be $2$ rows more.
$(x + 2)(y - 3) = xy$
$xy - 3x + 2y - 6 = xy$
$-3x + 2y = 6$ $...(ii)$
Adding equation $(i)$ and equation $(ii)$:
$(3x - y) + (-3x + 2y) = 3 + 6$
$y = 9$
Substituting $y = 9$ in equation $(i)$:
$3x - 9 = 3$
$3x = 12$
$x = 4$
Total number of students $= xy = 4 \times 9 = 36$.