Can we use string in switch statement?

Showing Answers 1 - 2 of 2 Answers

Ashok S Meti

  • Apr 29th, 2006
 

string cannot be used...........

  Was this answer useful?  Yes

Nadeem Yousuf

  • May 3rd, 2006
 

           We cannot use a string in switch statement nor can we use

              a floating point in switch statement. all we can use in a switch statement is a character and integer. Also we cannot use statements like

i<10 in case statements.This is the reason why switch can't replace IF statements although it allows us to make several choices depending upon the condition.

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions