IF statement

You have noticed that in the previous post, the first Problem given (and solved) uses the If-else statement.

The If-Else statement can be used for a series of tests on a value. The else part contains only another if statement  If you use if for the else part, it won't easy to see which of the series of tests are identical. Therefore, it is better to write them as If else.


In some cases, programmers use the Dangling If where there are a series of IF's, while some use the else if formatting since it the codes are clearer and readable.

No comments:

Post a Comment

Extended Search

Custom Search
Hello World