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
why do some people write if(0 == x) instead of if(x == 0)?
What is the use of bit field?
How can you tell whether two strings are the same?
What functions are in conio h?
How many bytes is a struct in c?
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
Why do we need functions in c?
Is javascript based on c?
main(){char *str;scanf("%s",str);printf("%s",str); }The error in the above program is: a) Variable 'str' is not initialised b) Format control for a string is not %s c) Parameter to scanf is passed by value. It should be an address d) none
What does char * * argv mean in c?
Explain the use of keyword 'register' with respect to variables.
How can I read data from data files with particular formats?
What tq means in chat?
What is the difference between abs() and fabs() functions?
In c programming language, how many parameters can be passed to a function ?