But the application has different answer
The elements in that array are from one to 10
But in switch case cases are for 1,3,7,8
ie
case 1://something
case 3:
case 7:
case 8:
when y is passed as parameter to switch value stored y will be 1. So one switch case will match ie: "C" will be printed but there are no break statement after it so it prints letters from other cases as well. Until now CPP! will be printed. Now when y is incremented value of y will be 2 so there will be no match in switch case, then again when y will be incremented value of y will be 3 so again it will print anything written in case 3. As there are no break statements it will keep on printing letters until last case is not done. So now the letters CPP!PP! will be printed and this will be followed till end