int a = 10; switch(a){ case 0: printf(\"case 0\"); break; case 1: printf(\"case 1\"); break; }
Is the above code valid?
If
It's same like no if condition is matched and else is not provided.
default is not an mandatory in switch case. If no cases are matched and default is not provided, just nothing will be executed.