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
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What is difference between Structure and Unions?
What are examples of structures?
What is bss in c?
What will the preprocessor do for a program?
What are pointers? Why are they used?
What is volatile variable in c with example?
Write a program to check prime number in c programming?
What is the use of c language in real life?
What are the Advantages of using macro
What is the incorrect operator form following list(== , <> , >= , <=) and what is the reason for the answer?
How will you divide two numbers in a MACRO?
How a string is stored in c?
Are the outer parentheses in return statements really optional?
If the size of int data type is two bytes, what is the range of signed int data type?