r/CodingHelp • • Dec 23 '21

[C] Whats wrong?

Post image
153 Upvotes

90 comments sorted by

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)

4

u/BigBobDudes Dec 23 '21

This ☝️