consider the following program sigment
int n,sum=1;
switch(n) {
case 2:sum=sum+2;
case 3:sum*=2;
break;
default:sum=0;}
if n=2, what is the value of sum
a.0
b.6
c.3
d.none

Answer Posted / sivasankar.a

the answer is d)none because there in no break statement

Is This Answer Correct ?    1 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by inheritance?

622


Why void is used in c?

558


What does void main () mean?

721


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

697


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

1793






why use "return" statement a) on executing the return statement it immediately transfers the control back to the calling program b) it returns the value present in the parentheses return, to the calling program c) a & b d) none of the above

604


Explain the difference between call by value and call by reference in c language?

637


What is an lvalue in c?

689


What is meant by operator precedence?

666


What is a rvalue?

743


Which is better between malloc and calloc?

664


Can the size of an array be declared at runtime?

599


What standard functions are available to manipulate strings?

554


typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?

1066


Explain what is gets() function?

620