The 5 people can seat in a row in 5! ways
But we need to exclude the ways that ann and bob are seated next to each other which is = 4! * 2!
So, the number of ways can ann, bob, chuck, don and ed be seated in a row such that ann and bob are not seated next to each other = 5! - 4! * 2! = 72
=====================================================
Another solution:
If ann seated in one of the ends, the number of ways = 3*2
If ann didn't seat in one of the ends , the number of ways = 2*3
So, the total number of ways that can ann, bob be seated = 3*2 + 2*3 = 12
The remaining persons can seat with a number of ways = 3! = 6
So, the total ways that the five persons can seat = 12*6 = 72