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
Why main is used in c?
the 'sizeof' operator reported a larger size than the calculated size for a structure type. What could be the reason?
What is scope rule in c?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
Study the following C program :call_me (myvar)int myvar;{ myvar +- 5; }main(){int myvar;myvar = 3;call_me(myvar);printf("%d ",myvar);What will be printed a) 3 b) 5 c) 8 d) symbol
What is a lvalue
What is #include in c?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is the use of f in c?
Why n++ execute faster than n+1 ?
Should I learn c before c++?
What is c language and why we use it?
What is volatile variable in c?
What is %lu in c?
What is FIFO?