...

/

if...else Statements

if...else Statements

Let's build upon our concepts of the original if statements with the else statement.

What is an if...else statement?

An if statement can be followed by an optional else statement, which executes when the conditional expression is FALSE.

Let’s revisit our previous example. So now, we not only want to print “positive” when we encounter a positive number, but we also want to print “negative” when the number is not positive.

We have used the ...