CoolInterview.com - World's Largest Collection of Interview Questions
Send Free SMS
 Interview Questions  
 Our Services  


INTERVIEW QUESTIONS LANGUAGES C DETAILS
Question :
A switch statement cannot include

a) constants as arguments
b) constant expression as arguments
c) string as an argument
d) None of the above


Category C Interview Questions
Rating (3.0) By 1 users
Added on 7/19/2006
Views 1381
Rate it!
Answers:

Switch statement can include string as argument.



A switch statement cannot include b)constant expression as arguments



 Posted by: SHANTHI    

Contact SHANTHI  Contact SHANTHI

A switch statement can not keep constant expression as arguments.



 Posted by: rahul ramesh koul    

Contact rahul ramesh koul  Contact rahul ramesh koul

A Switch Always expects an integer as an argument. Even if we pass a character also the ASCII Value of the char is considered. A string argument can never be passed to switch



 Posted by: Archana    

Contact Archana  Contact Archana


If you have the better answer, then send it to us. We will display your answer after the approval.
Name :*
Email Id :*
Answer :*
Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
Process Verification  Enter the above shown code:*
Inform me about updated answers to this question

   
Related Questions
View Answer
What do you mean by normalisation of pointers

View Answer
How to convert Stack in to Queue and v varsa ?
c with data structure.

View Answer
What would be the output of the following program?
main()
{
const int x=5;
int *ptrx;
ptrx=&x;
*ptrx=10;
printf("%d",x);
}


View Answer
According to ANSI specifications which is the correct way of declaring main() when it receives command line arguments?

View Answer
Would the following program compile?

main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf("n%u%u",j,k);
}




View Answer
If the following program (myprog) is run from the command line as myprog friday tuesday sunday,
What would be the output?

main(int argc, char *argv[])
{
printf("%c",*++argv[1]);
}




View Answer
If the following program (myprog) is run from the command line as myprog friday tuesday sunday, What would be the output?

main(int argc, char*argv[])
{
printf("%c",**++argv);
}




View Answer
Following declarations are different from one another
const char *const s;
char const *const s;



View Answer
What would be the output of the following program?

main()
{
char near * near *ptr1;
char near * far *ptr2;
char near * huge *ptr3;
printf("%d %d %d",sizeof(ptr1),sizeof(ptr2),sizeof(ptr3));
}




View Answer
Following declarations are same
const char *s;
char const *s;


View Answer

Please Note: We keep on updating better answers to this site. Subscribe to our newsletter to get notified when better answer is posted.

Notify me when better answer is posted!
Email:

View ALL C Interview Questions

User Options
Sponsored Links


Copyright ©2003-2010 CoolInterview.com, All Rights Reserved.
Privacy Policy | Terms and Conditions
Page URL: http://www.coolinterview.com/interview/6034/default.asp?cachecommand=bypass


Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Free SMS | Dedicated Servers | Joke of the Day

0.66