Increment variable in the If condition | variable increment and condition

How to increase the variable in the if condition statement
int sw=3;
If(sw==2)
SW=0;

If(sw==3)
SW++;
Else
SW+=2;
What is the value of sw
Debugging Answer:
4
Debugging solution:
it will go the loop 3 then increment value by 1 so it is become 4

Related post