Let a be the first term and d be the common difference.
We know that, sum of first n terms = Sn = [2a + (n − 1)d]
It can be observed that the number of trees planted by the students forms an A.P.
2, 4, 6, 8, ... , 24
Here, a = 2, d = 2 and n = 12.
= 6(4 + 22)
= 6(26)
= 156
Therefore, trees planted by 1 section of all the classes = 156.
Number of trees planted by 2 sections of all the classes = 2 × 156 = 312
Thus, 312 trees were planted by the students.