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 / vishnu nayak
it will display Hi. In case '1', 1 is a character and it is
converted into ascii equivalent and then tested, which is
not equal to 1.
if the code is like this
swithc(i)
{
case 1:
printf("hi");
break;
case 1:
printf("Hello ");
break;
} then it will surly give compilation error.
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.
Why is void main used?
#define f(g,h) g##h main O int i=0 int var=100 ; print f ("%d"f(var,10));} wat would be the output??
Explain is it valid to address one element beyond the end of an array?
Explain how do you list a file’s date and time?
Differentiate between calloc and malloc.
What is a null pointer in c?
What are the 5 data types?
Explain about the functions strcat() and strcmp()?
What is typedef example?
How can a program be made to print the name of a source file where an error occurs?
Explain indirection?
What is c system32 taskhostw exe?
What is %s and %d in c?
Why is sprintf unsafe?