========================================================
Explanation:
There are 1800 students total.
Take 2/5 of this to find the number of girls
(2/5)*1800 = 720 students are girls
Subtract that result from the total to get the number of boys
1800-720 = 1080 students are boys
We'll use this value later, so let A = 1080.
-------------
540 students do not play sports
(5/9)*540 = 300 girls do not play sports.
540-300 = 240 boys do not play sports
Let B = 240
------------
We found that
Therefore,
A-B = 1080 - 240 = 840 boys play sports