In case a,Since the value 7 is not avaliable in case statement it prints the value in default and since there is no break avaliable in default it prints both case 2 and 3.
But in the case of example b, The output is straight forward since z is avaliable in a case 'z': it just prints z.