I'm afraid I don't understand question, if there is such. But to understand the behaviour of this code snippet, I think the best way is to run the app in debug mode and see what happens.
Otherwise we'd need to run debugger here (in words), but that just would be the debugger's repetition, which you can do yourself.
If unclear, try to tell us line by line what you think happens there.
Here is the explanation about execution of your program.
Initially b value is false and i value is 1. Next do while loop . do while executes for the first time without condition checking.
Please observe the above do while loop condition. first you are negating b value and you are assigning that value to b again.
Control enters do while loop. i will becomes 2. next condition checking . while(b=!false) =>while(b=true) =>while(true). condition is true . so loop execution continues.
i will becomes 3. next condition checking. Now b value is true because of previous loop iteration. while(b=!true) =>while(b=false) =>while(false). condition is false. so loop execution terminates.
Now i value is 3. So the output is 3. Please correct me if anything is wrong.