The order of stack frames

Report a typo

There is a small program with three functions:

fun mult(a: Int, b: Int): Int {
    return a * b
}

fun printMult(a: Int, b: Int) {
    println(mult(a, b))
}

fun main() {
    printMult(3, 4)
}

Sort the lines in the order, in which stack frames will be pushed and removed to/from the call stack when running the main function. The first operation should be on the top.

Put the items in the correct order
pop main frame
push printMult frame
push main frame
pop printMult frame
push mult frame
pop mult frame
___

Create a free account to access the full topic