Conditional loops are common to any programming language you pick. If you apply multiple conditions on a loop, it is called a multiconditional loop. A simple example of a multiconditional loop in Java is illustrated here:
int[] data = {5,6,7,1,3,4,5,7,12,13};
for(int i=0;i<10&&i<data[i];i++){
System.out.println(data[i]);
}
The preceding code on execution will print out 5, 6, and 7. Let's see how we can use a multiconditional loop in Kotlin. We will be looking at a functional approach to the same thing in Kotlin.