lets try to understand whats happening here :
value of a assigned to 50. this value of a=50 is fed as an argument to switch case.
which goes to : case 50: a--; (a=a-1 (internally ))
value of a =49
now case 51 : a=a+1 will also be executed and : a= 49+1 =50
If you don't include break in any of case then all the case below will be executed and until it sees break.
so value of a at the end 50 result.
my doubt is the default case is not executed here why??, what is a value of a the end??
its because the argument fed into switch () will go to the case containg that argument.
and if argument of switch() doesnot belong to any case statement than only it will execute default case.