In the case of a pendulum swinging from position A to position B, if we do not consider friction or any other non-conservative forces, the total mechanical energy of the pendulum remains the same throughout the swing. As the pendulum moves, potential energy is converted into kinetic energy and vice versa, but the sum of the total mechanical energy (potential energy + kinetic energy) remains constant.
So, the correct answer is:
It remains the same.