Descending digits dance

Report a typo
Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
Create a program that prints a countdown from a given number to 1 using a while loop. The program should take a single positive integer as input and print each number in the countdown on a separate line.

Sample Input 1:

5

Sample Output 1:

5
4
3
2
1

Sample Input 2:

3

Sample Output 2:

3
2
1
Write a program in Kotlin
import java.util.Scanner

fun main() {
val scanner = Scanner(System.`in`)
val number = scanner.nextInt()

// Implement the countdown using a while loop

}

Create a free account to access the full topic