EmbLogic's Blog

c assignment doubt

#include
char input[]=”SSSWILTECH1\1\11W\WALLMP1″;
int main()
{
int i,c;
for(i=2;(c=input[i])!=”;i++)
{
switch(c)
{
case ‘a’:putchar(‘i’);continue;
case ’1′:break;
case 1:while((c=input[++i])!=’\1′&&c!=”);
case 9:putchar(‘S’);
case’E’:
case’L’:continue;
default:putchar(c);continue;
}
putchar(‘ ‘);
}
return 0;
}

the output of this program is “SWITCH S”
i know the reason for “SWITCH ”
but, Why (or how) does the output has “S” in the end …?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>