int a = 10; switch(a){ case 0: printf(\"case 0\"); break; case 1: printf(\"case 1\"); break; }
Is the above code valid?
If
Default is not mandatory but always good to have it. The code is ideally but our life is not, no harm to put a protection there. It will also help you debugging if any unexpected thing happens.