DIR Return Create A Forum - Home
---------------------------------------------------------
techsuns
HTML https://techsuns.createaforum.com
---------------------------------------------------------
*****************************************************
DIR Return to: OutPut of a Program
*****************************************************
#Post#: 220--------------------------------------------------
What is the output
By: ravusairam Date: November 27, 2012, 4:29 am
---------------------------------------------------------
#include<stdio.h>
int main()
{
int a=10;
switch(a)
{
case '1':
printf("ONE\n");
break;
case '2':
printf("TWO\n");
break;
defa1ut:
printf("NONE\n");
}
return 0;
}
#Post#: 226--------------------------------------------------
Re: What is the output
By: kpr29 Date: November 27, 2012, 9:01 am
---------------------------------------------------------
@Ravu:The spelling of defa1ut is wrong.......... I was expecting
error. But suprisingly no error was thrown
#Post#: 229--------------------------------------------------
Re: What is the output
By: kranthipls Date: November 27, 2012, 9:09 am
---------------------------------------------------------
@kp So trace back the error.................. What do you call a
word followed by a colon in C?
#Post#: 231--------------------------------------------------
Re: What is the output
By: kpr29 Date: November 27, 2012, 9:15 am
---------------------------------------------------------
@Kranthi: Is it keyword.........
#Post#: 244--------------------------------------------------
Re: What is the output
By: kranthipls Date: November 27, 2012, 11:19 pm
---------------------------------------------------------
No dude it will become a label which can be used by a goto at a
later stage of the program..........
#Post#: 247--------------------------------------------------
Re: What is the output
By: kpr29 Date: November 27, 2012, 11:27 pm
---------------------------------------------------------
@Kranthi: I thought of goto statement, but forget the word
label..............Thanks
*****************************************************