The correct option is
B 5040Now as
A and
B are next to each other so we assume them as one. So now total people will be
7.
Now C should be somewhere behind D, therefore we need to consider all cases according to positions of D.
(i) When D is at first position C can be placed at any remaining 6 positions=Total ways to arrange remaining 6 people(D is at first)=6!
(ii)When D is at second position C can be placed only at remaining 5 positions after D, so at first position there can be only 5 people=Total ways will be=5×5!
(iii)When D is at third position C can be placed only at remaining 4 positions after D, so at first and second there can be only 5×4 choices=Total ways will be=5×4×4!
Similarly (iv) When D is at fourth position, Total ways =5×4×3×3!
(v)When D is at fifth position, Total ways=5×4×3×2×2!
(vi)When D is at sixth position, Total ways=5×4×3×2×1×1!
(vii)D can't be at seventh position because that's the last position so then C can't be behind D.
Now as A and B together can sit in two ways=AB or BA
∴ Total ways=2×[(i)+(ii)+(iii)+(iv)+(v)]
=2×[6!+5×5!+5×4×4!+5×4×3×3!+5×4×3×2×2!+5×4×3×2×1×1!]
=2×[720+600+480+360+240+120]=2×2520=5040
Hence, (B)