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   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip       Ask Questions on ANYTHING, that arise in your Daily Life at     FORUM9.COM
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
f1()
{
f(3);}
f(int t)
{
switch(t);
{
case 2: c=3;
case 3: c=4;
case 4: c=5;
case 5: c=6;
default: c=0;}
value of c?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?
Answer
# 1
The above code returns a compiler error:

1.In C functions cannot be made inline.
2.A semi-colon is not expected after switch.
 
Is This Answer Correct ?    0 Yes 0 No
Ningappa
 
  Re: f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?
Answer
# 2
As t = 3,it goes to case 3.But there is no break in that 
case so it proceeds further down to default and c becomes 0.
 
Is This Answer Correct ?    1 Yes 0 No
Madhu
 
 
 
  Re: f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?
Answer
# 3
Yeah value of c becomes 0 at the end of the program..
 
Is This Answer Correct ?    1 Yes 0 No
Shruti
 
  Re: f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?
Answer
# 4
Initially, switch statement is ended with semicolon.so 
cases will not be alone without switch.It is compilation 
error.
If semicolon is not there in switch statement answer is 
zero.
 
Is This Answer Correct ?    1 Yes 0 No
Poornima
 
  Re: f1() { f(3);} f(int t) { switch(t); { case 2: c=3; case 3: c=4; case 4: c=5; case 5: c=6; default: c=0;} value of c?
Answer
# 5
c=6.... since no break statement
 
Is This Answer Correct ?    1 Yes 0 No
Vignesh1988i
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
Please list all the unary and binary operators in C.  1
what is a headerfile?and what will be a program without it explain nan example? Assurgent2
related to rdbms query .  1
To what value do nonglobal variables default? 1) auto 2) register 3) static  4
helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe  1
long int size a) 4 bytes b) 2 bytes c) compiler dependent d) 8 bytes HCL10
Write code for initializing one dimentional and two dimentional array in a C Program? Deshaw5
logic for generating all the combinations of the any number of given letters. ex::::::::: if a,b,c,d are given the o/p should be abcd,dcba,dbac,bcad,................ 4*3*2*1 combinations............ Infosys1
Determine the code below, tell me exactly how many times is the operation sum++ performed ? for ( i = 0; i < 100; i++ ) for ( j = 100; j > 100 - i; j--) sum++; ITCO3
what is the use of call back function in c?tell me with example  1
what is the advantage of function pointer TCS9
what are two categories of clint-server application development ?  1
how to find the kth smallest element in the given list of array elemnts. Silicon3
You are given a string which contains some special characters. You also have set of special characters. You are given other string (call it as pattern string). Your job is to write a program to replace each special characters in given string by pattern string. You are not allowed to create new resulting string. You need to allocate some new memory to given existing string but constraint is you can only allocate memory one time. Allocate memory exactly what you need not more not less. Microsoft1
write a function to find whether a string is palindrome or not and how many palindrome this string contain?  1
How can I invoke another program from within a C program?  1
which one is not preprocessor directive a)#if b)#elif c)#undef d)#pragma Wipro11
what will be the output: main(){char ch;int a=10;printf("%d",ch);} Wipro24
f(x,y,z) { y = y+1; z = z+x; } main() { int a,b; a = 2 b = 2; f(a+b,a,a); print a; } what is the value of 'a' printed  4
x=2,y=6,z=6 x=y==z; printf(%d",x) HCL7
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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