I came across this puzzle here. I can\'t figure out why NONE is not printed. Any ideas?
#include
int main()
{
int a=10;
If defa1ut is a typo for default and the string "NONE" is printed:
This is because '1' and 1 is different.
'1' means the ASCII value of the character '1' whose value in decimal is 49. and 1 is an integer.
The first case will be true if the value of a is 49 or '1' , but as a=10 so it is neither equal to '1' nor equals to '2' and thus default is executed (if it existed, and defa1ut is not a typo).
If defa1ut is not a typo for default and simply nothing is printed:
In this case you have no default instead which look like it is defa1ut which will act as a normal label, so simply nothing will be printed.