The given AP is 2, 7, 12, ..., 47.
Let us re-write the given AP in reverse order i.e. 47, 42, ..., 12, 7, 2.
Now, the 5th term from the end of the given AP is equal to the 5th term from beginning of the AP 47, 42, ..., 12, 7, 2.
Consider the AP 47, 42, ..., 12, 7, 2.
Here, a = 47 and d = 42 − 47 = −5
5th term of this AP
= 47 + (5 − 1) × (−5)
= 47 − 20
= 27
Hence, the 5th term from the end of the given AP is 27.