main()
{
char as[] = "\\0\0";
int i = 0;
do{
switch( as[i++]) {case '\\' : printf("A");
break;
case 0 : printf("B");
break;
default : printf("C");
break;
}}
while(i<3);
}
Answer Posted / lakshman
ABC is correct answer, because in first condition switch(0)=\ then it prints the character "A" ,then its break. in next condition switch(1)=0 then its prints the character "B" . In final condition switch(2)= ,it does not match any case value so default condition is executed that means character "C" will print, so the final answer is ABC
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What is static and volatile in c?
How many bytes are occupied by near, far and huge pointers (dos)?
Explain the difference between exit() and _exit() function?
What is the use of ?: Operator?
What are global variables and how do you declare them?
I have seen function declarations that look like this
How will you write a code for accessing the length of an array without assigning it to another variable?
How do you define structure?
Explain the Difference between the New and Malloc keyword.
What is self-referential structure in c programming?
How can a program be made to print the line number where an error occurs?
What is the explanation for prototype function in c?
What is the difference between a string and an array?
What is indirection?
What are static variables in c?