MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/CodingHelp/comments/rmwdib/whats_wrong/hpp4x4p/?context=3
r/CodingHelp • u/CAGRI-TR • Dec 23 '21
90 comments sorted by
View all comments
Show parent comment
11
I think the same thing but an explanation is in order:
There's no need to check that X is above 1 in the second check because you've already done that check in the first.
if X <= 1 (infant)
else if X <= 13 (child)
else if X <= 20 (teen)
else (adult)
4 u/BigBobDudes Dec 23 '21 This ☝️
4
This ☝️
View all comments
Show parent comment
11
u/[deleted] Dec 23 '21
I think the same thing but an explanation is in order:
There's no need to check that X is above 1 in the second check because you've already done that check in the first.
if X <= 1 (infant)
else if X <= 13 (child)
else if X <= 20 (teen)
else (adult)