Question

The if/else selection structure can always do what the switch structure does but the reverse is...

The if/else selection structure can always do what the switch structure does but the reverse is not true

True

False

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi,

The if/else selection structure can always do what the switch structure does but the reverse is not true - TRUE

To understand it better, please see the key differences between if/else selection and switch structure.

  1. If-else statement checks for equality as well as for logical expression. On the other hand, switch checks only for equality.
  2. The if statement evaluates integer, character, pointer, or floating-point type or boolean type. On the other hand, the switch statement evaluates only character or an integer data type.
  3. You can have multiple if statements for multiple choice of statements. In switch, you only have one expression for the multiple choices.

So, from the differences between if/else and switch you can understand that, Using if/else we can do all the things that can be done by if/else and switch. but the switch structure has its limitations as given above, so the reverse is not true.

Hope this answer helps you!!
Thanks.

Add a comment
Know the answer?
Add Answer to:
The if/else selection structure can always do what the switch structure does but the reverse is...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT