Correct option is A
Given
Time taken by A alone = 30 days
Time taken by B alone = 40 days
Total time taken to complete the work = 18 days
A leaves 5 days before the work is completed.
Solution
The problem explicitly states that the entire work was completed in 18 days.
It also states that A left 5 days before the completion of the work.
Therefore, the number of days A worked is:
Days A worked = 18 - 5 = 13 days.
Final Answer
So the correct answer is (a)