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

What is size of union in c?

0 Answers  


What is infinite loop?

0 Answers  


Write a C program to print 1 2 3 ... 100 without using loops?

15 Answers   Hindalco,


Define a structure to store roll no, name and marks of a student. Using the structure of above write a ‘C’ program to create a file “student.dat”. There must be one record for every student in the file. Accept the data from the user.

0 Answers  


a memory of 20 bytes is allocated to a string declared as char *s then the following two statements are executed: s="Etrance" l=strlen(s); what is the value of l ? a.20 b.8 c.9 d.21

4 Answers   TCS,






Write code for finding depth of tree

2 Answers   Adobe,


12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV

4 Answers   Accenture,


What is the use of bitwise operator?

0 Answers  


Why we use stdio h in c?

0 Answers  


how can we use static and extern?and where can we use this?

3 Answers   Excel,


what is the use of ~ in c lang?????

3 Answers  


What is type qualifiers?

0 Answers  


Categories