Invocation

Report a typo

Imagine you have a function that outputs three sorted numbers:

fun printSortedNumbers(a: Int, b: Int, c: Int, asc: Boolean = true, abs: Boolean = false) = ...

You can change the sorting order with an asc parameter. By default, the function sorts values in ascending order. Also, if you set abs = true, you can sort the numbers by the absolute value.

Example:

printSortedNumbers(-6, -2, 4, false, true)  // prints -6 4 -2

Match each invocation of this function with its output.

Match the items from left and right columns
printSortedNumbers(-2, 3, 1)
printSortedNumbers(-2, 3, 1, false)
printSortedNumbers(-2, 3, 1, true, true)
printSortedNumbers(-2, 3, 1, false, true)
1 -2 3
3 1 -2
3 -2 1
-2 1 3
___

Create a free account to access the full topic