Create a thread with the name numbersFilter by using the function thread(). It should read integer numbers from the standard input (line by line). If the number is even, the filter must print it to the standard output (each number on a new line); if the number is 0, the filter must stop.
Custom threads
Numbers filter
Report a typo
Sample Input 1:
1
2
3
4
0Sample Output 1:
2
4Write a program in Kotlin
fun main() {
val numbersFilter = thread(block = {
//write your code here
})
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.