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);
}

Answers were Sorted based on User's Feedback



main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : ..

Answer / srikanth

ACB

Is This Answer Correct ?    18 Yes 1 No

main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : ..

Answer / dishank

darpan can u plz explain me how does the answer AB comes...

Is This Answer Correct ?    0 Yes 2 No

main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : ..

Answer / 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

main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : ..

Answer / darpan

AB

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More C Interview Questions

Write a program in C to reverse a number by recursive function?

1 Answers  


What is an identifier?

0 Answers  


What is anagram in c?

0 Answers  


Why cd or dvd are round why not square.

1 Answers  


What are the rules for identifiers in c?

0 Answers  






Bit swapping

2 Answers  


What are the different types of errors?

0 Answers  


Explain what are the different file extensions involved when programming in c?

0 Answers  


Are enumerations really portable?

0 Answers  


what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CHOUDHARY" }; printf("\nstring1=%s",str[0]); printf("\nstring2=%s",str[1]); printf("\nstring3=%s",str[2]); a)string1=Manish string2=Kumar string3=Choudhary b)string1=Manish string2=Manish string3=Manish c)string1=Manish Kumar Choudhary string2=(null) string3=(null) d)Compiler error

9 Answers   Infosys,


What is getch() function?

0 Answers  


How was c created?

0 Answers  


Categories