Assuming mx and my as binary semaphores ,
The part of the code which is doing down operation on 'mx' will be successful initially and not the one doing down operation on 'my' variable..
Hence the code corresponding to 'mx' variable will be executed first followed by that of 'my' variable..This will not be executed other way as down on 'my' variable is not possible initially..
Hence the code will runs :
P(mx) ;
x = x + 1 // x is incremented to 1
V(my) ; // my is set to 1 now
P(my) ; // successful down operation
x = y + 1 // x is updated as 23 + 1 = 24..
V(mx) ;
This way the entire code is executed ..Thus the second part will execute after first part only.Thus final value of 'x' is decided by the second part..
Hence final value of x = 24