GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  Sonata  >  C
Go To First  |  Previous Question  |  Next Question 
 C  |  Question 28 of 31    Print  
A switch statement cannot include
a) constants as arguments b) constant expression as arguments
c) string as an argument d) None of the above


  
Total Answers and Comments: 1 Last Update: October 23, 2005   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 23, 2005 18:09:36   #1  
shrutimitra Member Since: October 2005   Contribution: 16    

RE: A switch statement cannot include
c) string as an argument
 
Is this answer useful? Yes | No

 Related Questions

Point out error, if any, in the following program main() { int i=1; switch(i) { case 1: printf("nRadioactive cats have 18 half-lives"); break; case 1*2+4: printf("nBottle for rent -inquire within"); break; } }
No error. Constant expression like 1*2+4 are acceptable in cases of a switch.  

What would be the output of the following program? main() { int i=4; switch(i) { default: printf("n A mouse is an elephant built by the Japanese"); case 1: printf(" Breeding rabbits is a hair raising experience"); break; case 2: printf("n Friction is a drag"); break; case 3: printf("n If practice make perfect, then nobody's perfect"); } } a) A mouse is an elephant built by the Japanese b) Breeding rabbits is a hare raising experience c) All of the above

In the following code; #include main() { FILE *fp; fp= fopen("trial","r"); } fp points to: a) The first character in the file. b) A structure which contains a "char" pointer which points to the first character in the file. c) The name of the file. d) None of the above.
Tags : Pointer

According to ANSI specifications which is the correct way of declaring main() when it receives command line arguments? a) main(int argc, char *argv[]) b) main(argc,argv) int argc; char *argv[]; c) main() {int argc; char *argv[]; } d) None of the above 26. What error would the following function give on compilation? f(int a, int b) { int a; a=20; return a; } a) missing parenthesis in the return statement b) The function should be declared as int f(int a, int b) c) redeclaration of a d) None of the

A switch statement cannot include a) constants as arguments b) constant expression as arguments c) string as an argument d) None of the above


 Sponsored Links

 
Related Articles

What are the limitations with switch statement?

Switch statement is a powerful statement used to handle many alternatives and provides good presentation for C program. But there are some limitations with switch statement which are given below: Logical operators cannot be used with switch statement. For instance case k>=20: is not allowe
 

goto Statement

Why to avoid goto in C C has goto statement but one must ensure not to use too much of goto statement in their program because its functionality is limited and it is only recommended as a last resort if structured solutions are much more complicated. First let us understand the goto statement, its
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape