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 is the most efficient way to store flag values?
What is the use of in c?
What is pointer to pointer in c language?
How can I trap or ignore keyboard interrupts like control-c?
What is the argument of a function in c?
What is binary tree in c?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
Write a program in c to replace any vowel in a string with z?
what do the 'c' and 'v' in argc and argv stand for?
What are runtime error?
Explain how does free() know explain how much memory to release?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is hash table in c?
How would you rename a function in C?
What is variable declaration and definition in c?