int main()
{
int i=1;
switch(i)
{
case '1':
printf("hello");
break;
case 1:
printf("Hi");
break;
case 49:
printf("Good Morning");
break;
}
return 0;
}

Answer Posted / srsabariselvan

The program Results in Error.
it will shows error "Duplicate case".
because '1' is equal to 49(ASCII of character 1).

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

When would you use a pointer to a function?

796


What is printf () in c?

779


What is omp_num_threads?

823


What is an operator?

845


formula to convert 2500mmh2o into m3/hr

749


What is a char c?

794


Explain what are the standard predefined macros?

863


Where does the name "C" come from, anyway?

861


Why is extern used in c?

827


can anyone suggest some site name..where i can get some good data structure puzzles???

1839


What is gets() function?

854


What are lookup tables in c?

751


In a header file whether functions are declared or defined?

881


What is the basic structure of c?

771


What is pointer to pointer in c language?

790