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
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
What is the equivalent code of the following statement in WHILE LOOP format?
What are valid signatures for the Main function?
Differentiate between #include<...> and #include '...'
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
Hai what is the different types of versions and their differences
What are the types of operators in c?
what is the format specifier for printing a pointer value?
What are the types of variables in c?
When should the register modifier be used? Does it really help?
How does struct work in c?
Is c easy to learn?
Why c language?
What does nil mean in c?
What is the return type of sizeof?