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

What is class and object in c?

581


Why is %d used in c?

559


In C language, a variable name cannot contain?

733


What is extern keyword in c?

637


What type of function is main ()?

579






any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

650


a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list

629


How can I find out the size of a file, prior to reading it in?

614


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

569


a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

639


Explain the difference between malloc() and calloc() in c?

570


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

628


explain what is an endless loop?

605


What is anagram in c?

510


What are the 5 elements of structure?

557