Follow the call stack

Report a typo

You have the following call stack:

call stack

Write a program for checking if the input number is prime. Create the printIfPrime(number: Int) function and print %your_number% is a prime number. if the number is prime; otherwise, print %your_number% is not a prime number.

Hint: The number 1 is more interesting than it seems. Despite seeming so, mathematically it is not a prime number.

Sample Input 1:

5

Sample Output 1:

5 is a prime number.

Sample Input 2:

12

Sample Output 2:

12 is not a prime number.
Write a program in Kotlin
fun printIfPrime(number: Int) {
// write here
}

fun main(args: Array<String>) {
// write here
}
___

Create a free account to access the full topic