Kotlin

Kotlin If Else If Statement Example1 min read

Kotlin Code:

Output:




If else if statment in kotlin makes a ladder of conditions, if one statement finds true it will exit from the if else if ladder.

In the above program you can see the if else if ladder with three conditions. If number > 0 it will take positive number as the return value, else if it will take the negative value.

If all condition is not satisfied it will take last else part.

Leave a Comment