case (1||2):
printf("hi");
Just put brackets and see the magic.
In your code,the program just check the first value and goes down.Since,it doesn't find 2 afterwards it goes to default case.
But when you specific that both terms i.e. 1 and 2 are together, using brackets, it runs as wished.