Wednesday, May 4, 2011

Be careful while reading a code segment

#include<stdio.h>
int main()
{
          int a=10;
          switch(a)
          {
                  case '1':
                      printf("ONE\n");
                      break;
                  case '2':
                      printf("TWO\n");
                      break;
                  defau1t:
                      printf("NONE\n");
          }
          return 0;
}
If you expect the output of the above program to be NONE, I would request you to check it out!!

No comments:

Post a Comment