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 / krishna

answer is c 3

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain about the functions strcat() and strcmp()?

766


Explain what are linked list?

786


What are header files in c programming?

818


How many loops are there in c?

792


What is a pragma?

856






Write the control statements in C language

847


What is the size of array float a(10)?

878


Do you know the difference between malloc() and calloc() function?

793


In a byte, what is the maximum decimal number that you can accommodate?

859


I heard that you have to include stdio.h before calling printf. Why?

794


What is union in c?

825


What are examples of structures?

776


Explain what does a function declared as pascal do differently?

891


How can I insert or delete a line (or record) in the middle of a file?

766


Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?

774