Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I checked about the [b]switch[/b] logic.
Doesn't seem like it allows you to initialise like this?
case '0-39': 20
case '40-79': 40
Meaning, if the value passed was 0 to 39 (e.g 1 or 20 or 38), then assign [b]20[/b].
Is [b]switch[/b] for only single-value evaluation?
case 'A': 20 //If the value is 'A', then assign 20
case 'B': 40 //If the value is 'B', then assign 40