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
what are enumerations in C
Explain enumerated types.
What is unary operator?
What is far pointer in c?
What is volatile variable how do you declare it?
What are the rules for identifiers in c?
What is the process of writing the null pointer?
What functions are used in dynamic memory allocation in c?
Why c is procedure oriented?
How can you be sure that a program follows the ANSI C standard?
Is c still used?
Explain how can I remove the trailing spaces from a string?
What is use of bit field?
What is the significance of c program algorithms?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b