Read the code literally as given (the semicolon placement matters), then test the two standard properties: (i) can both processes be inside the critical section at the same time, and (ii) can a process be blocked forever waiting for the other. Mutual exclusion is a necessary condition for deadlock, and here it is exactly the property that breaks first.
The flags are set before the other's flag is tested and there is no semicolon terminating the while condition, so the critical section lies inside the loop body. Both processes can therefore pass their tests simultaneously and execute the critical section together, breaking mutual exclusion. Deadlock cannot arise because mutual exclusion - a necessary condition for deadlock - is not satisfied, and in practice every process resets its own flag inside the body, so the other's loop condition eventually becomes false. Hence option (A).