Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Switch Statement with Intervals

+4 votes
asked Nov 30, 2023 by Marco Pisco (190 points)
I'm using GDB online for school, and I'm stuck on a problem:

Our teacher states that we HAVE to use intervals in Switch statements (for reference, we're learning C++) and I'm stuck, because I can't find any awnsers on Google.

How can I use intervals with switch statements?

1 Answer

0 votes
answered Dec 5, 2023 by Peter Minarik (82,920 points)
selected Dec 5, 2023 by Marco Pisco
 
Best answer
Probably this is what the teacher meant:

https://www.geeksforgeeks.org/using-range-switch-case-cc/
commented Dec 5, 2023 by Marco Pisco (190 points)
Yes, she ended up showing us how to do it, because we couldn't find it.
Thank you.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...