Calculate Square

Report a typo

You need to implement the calculateSquare method.

It should output the square of the element defined by the provided array index using println() function. In the case when the exception might happen, your program output should be: Exception!

Write a program in Kotlin
fun calculateSquare(array: IntArray?, index: Int) {
// write your code here
}
___

Create a free account to access the full topic