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 / roopa
The anser is d i.e. NONE.
Case 2 does not have the break statement.
so sum becomes 8
Is This Answer Correct ? | 2 Yes | 13 No |
Post New Answer View All Answers
Is c high or low level?
What are the restrictions of a modulus operator?
Can static variables be declared in a header file?
How are Structure passing and returning implemented by the complier?
write a program to generate address labels using structures?
formula to convert 2500mmh2o into m3/hr
What is structure in c definition?
How do you convert strings to numbers in C?
What is operator precedence?
What are categories used for in c?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
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
What is NULL pointer?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
Why & is used in c?