main()

{

int i=3;

switch(i)

{

default:printf("zero");

case 1: printf("one");

break;

case 2:printf("two");

break;

case 3: printf("three");

break;

}

}



main() { int i=3; switch(i) { default:printf("zero"); c..

Answer / susie

Answer : :

three

Explanation :

The default case can be placed anywhere inside
the loop. It is executed only when all other cases doesn't
match.

Is This Answer Correct ?    18 Yes 3 No

Post New Answer

More C Code Interview Questions

main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;

1 Answers  


Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)

7 Answers   Microsoft,


int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().

2 Answers  


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).

13 Answers   Intel, Microsoft, TCS,






# include <stdio.h> int one_d[]={1,2,3}; main() { int *ptr; ptr=one_d; ptr+=3; printf("%d",*ptr); }

1 Answers  


write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).

0 Answers   CDAC, College School Exams Tests,


main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 Answers  


void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

2 Answers  


Sorting entire link list using selection sort and insertion sort and calculating their time complexity

1 Answers   Infosys, Microsoft, NetApp,


How we print the table of 3 using for loop in c programing?

7 Answers  


Is the following code legal? typedef struct a { int x; aType *b; }aType

1 Answers  


Categories