Correct Answer  Option 2 : 12 hours
Given:
Pipe A can fill the tank in 6 hours
B can empty a filled tank in 8 hours
Concept used:
Work = time × efficiency
Calculation:
Work 
Time 
Efficiency 
A 
6 hours 
24/6 = 4 
B 
8 hours 
24/8 = 3 
Total work (LCM of time) 
24 units 

Amount of work done by A in first 4 hours = 4 × 4 = 16 units
Remaining work = 24  16 = 8 units
Now, both A and B are working together, total efficiency = 4  3 = 1
Time taken to finish work = work/efficiency = 8/1
Total time taken = 4 + 8 = 12 hours
∴ Total time taken is 12 hours.