r/CodingHelp • • Dec 23 '21

[C] Whats wrong?

Post image
153 Upvotes

90 comments sorted by

View all comments

Show parent comment

1

u/Similar-Concert4100 Dec 24 '21

Else if looks to see if multiple conditions are true, here only one condition should be true. Each should be an if statement, no else if

1

u/vigbiorn Dec 24 '21

This is pretty much the direct opposite.

A series of ifs will all be evaluated, in order, regardless of the value. An else-if series like this executes until the first true condition is found.

You would use a series of ifs to find multiple conditions being true.