Modify this code please. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Modify this code please.

Hello can anyone help to change the code as such is the age if <= 16 it should say "too young" and the age is >=42 it should say "Adult" and if the age is >=72 it should say "Senior". Thanks! https://code.sololearn.com/cAAxX76I7uxW/?ref=app https://code.sololearn.com/cAAxX76I7uxW/?ref=app

21st Dec 2017, 5:38 AM
Micro Pixels
Micro Pixels - avatar
2 Answers
+ 2
Can't use ranges in switch statements in standard c++. Some compilers allow for stuff like "case 17...42:", others don't, so it isn't recommended to use. Use else if statements to define ranges, it's more reliable. Reply back if you need me to modify it to use else if instead of switch.
21st Dec 2017, 5:56 AM
BlazingMagpie
BlazingMagpie - avatar
0
its done thanks!!!
21st Dec 2017, 6:03 AM
Micro Pixels
Micro Pixels - avatar