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
How do I create a directory? How do I remove a directory (and its contents)?
What is function pointer c?
What are qualifiers?
Explain how do you generate random numbers in c?
Explain how can I pad a string to a known length?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Tell us two differences between new () and malloc ()?
Is that possible to add pointers to each other?
Explain threaded binary trees?
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What is a double c?
What is sizeof c?
What is the use of linkage in c language?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What is restrict keyword in c?