Let the seat occupied by A be numbered as 1 and the remaining 5 seats be numbered as 2,3,4,5,6 in anticlockwise direction. There arise two cases:
Case I: B is on immediate right of A, i.e. at number 2.
Then seat number 3 can be occupied by C or D in 2C1 ways and remaining 3 persons can have remaining 3 seats in 3! ways.
Hence, the number of arrangements in this case
= 2C1×3!=2×6=12
Case II: C is on the immediate right of A i.e. at number 2.
Then, B can occupy any seat from number 3 or 4 or 5(not 6). Then D must be on the right of B, so we are left with two persons and 2 seats, which can be occupied in 2! ways.
Hence, the number of arrangements in this case
= 3C1×2!=3×2=6
These cases are exclusive. So by sum rule, the total number of arrangements
=12+6=18