ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
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
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: 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
# 1
6
 
Is This Answer Correct ?    5 Yes 0 No
Guest
 
  Re: 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
# 2
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 3 No
Roopa
 
 
 
  Re: 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
# 3
6
 
Is This Answer Correct ?    2 Yes 0 No
Mytri
 
  Re: 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
# 4
the answer is d)none because there in no break statement
 
Is This Answer Correct ?    1 Yes 0 No
Sivasankar.a
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
What is structure padding ? HP2
what is available in C language but not in C++?  1
how to print "hai" in c?  10
program to get the remainder and quotant of given two numbers with out using % and / operators? IBM8
the number 138 is called well ordered number because the three digits in the number (1,3,8) increase from left to right (1<3<8). the number 365 is not well ordered coz 6 is larger than 5. write a program that wull find and display all possible three digit well ordered numbers. sample: 123,124,125,126,127,128,129,134 ,135,136,137,138,139,145,146,147 148 149,156.......789  3
what is the output? #define fun(a,b,t) (g ##t=(a),(a)=(b),(b)=g##t) float gfloat; main() { float a=1.12,b=3.14; fun (a,b,float); printf("na=%4.2f,b=%4.2f",a,b); } A)Error in Defining Macro B)a=1.12,b=3.14 C)a=3.14,b=1.12 D)None of the Above Accenture2
int *p=20; if u print like dis printf("%d",p); o\p:- 20; how is it possible? plz give me the explanation. Global-Edge11
Find the middle node in the linked list?? (Note:Do not use for loop, count and count/2) Subex2
main() { int i,j,A; for(A=-1;A<=1;A++) prinf("%d\t",!!A); }  5
How does free() know how many bytes to free?  5
what is the advantage of software development  1
What is macro? IBM4
how memory store byte Huawei3
What's wrong with "char *p = malloc(10);" ?  4
what is the output of the following program? #include<stdio.h> void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } }  4
what are the uses of structure? HCL5
Write a program which take a integer from user and tell whether the given variable is squar of some number or not. eg: is this number is 1,4,9,16... or not Alcatel8
WAP TO ACCEPT STRING AND COUNT A COMES N TIMES B COMES N TIMES C COMES N TIMES D COMES N TIMES AND SO ON......... AT LAST UNTIL Z COMES N TIMES...............  3
dynamically allocate memory for linear array of n integers,store some elements in it and find some of them  1
What is structure packing ? HP1
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com