for loop kotlin

fun main() {
    val numbers = listOf(1, 2, 3, 4, 5)

    for (number in numbers) {
        println("Current number: $number")
    }
}
  1. Declare a function named main.
  2. Create a constant numbers and assign it a list of integers (1, 2, 3, 4, 5).
  3. Start a for loop to iterate over each element in the numbers list.
  4. Declare a variable number to represent the current element in the iteration.
  5. Print the current number using println with the string "Current number: " followed by the value of the number variable.
  6. Repeat steps 4-5 for each element in the numbers list.
  7. End the for loop.
  8. End the main function.