bob earns $ 540 biweekly and tom earns $ 780 bimonthly. Who earns a greater annual salary.

540*26 = 14,040

780 * 6 = 4,680

It appears you meant $780 semi-monthly:
780 * 24 = 18,720

"biweekly" as well as "bimonthly" are confusing terms.

If we interpret "biweekly" as every other week (26 in a year), then
"bimonthly" has to mean every other month, (6 in a year).

Even Webster doesn't really know:
Google "The Ambiguity of 'Biweekly' and 'Bimonthly' Merriam-Webster"

(Just another bug in the English language)