logo CodeStepByStep logo

parameter_mystery7

Language/Type: PHP parameter mystery parameters return

The following console program uses parameters and produces four lines of output. What are they?

function mystery($b, $c, $a) {
    $c++;
    print("$c $a $b\n");
    return $a + 2;
}

$a = 10;
$b = 4;
$c = $a + $b;

$d = mystery($a, $b, $c);
$b--;
$c = mystery($c, $d, $a);
mystery($a, $c, $b);
print("$a $b $c $d\n");
line 1
line 2
line 3
line 4

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.