logo CodeStepByStep logo

ParameterMysteryExam5

Language/Type: C# parameters return

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

public class ParameterMysteryExam5
{
    public static void Main()
    {
        int a = 10;
        int b = 4;
        int c = a + b;

        int d = Mystery(a, b, c);
        b--;
        c = Mystery(c, d, a);
        Mystery(a, c, b);
        Console.WriteLine(a + " " + b + " " + c + " " + d);
    }

    public static int Mystery(int b, int c, int a)
    {
        c++;
        Console.WriteLine(c + " " + a + " " + b);
        return a + 2;
    }
}
line 1
line 2
line 3
line 4

You must log in before you can solve this problem.

Log In

Need help?

If you do not understand how to solve an exercise or why your solution doesn't work, please contact your TA or instructor.
If something seems wrong with the site (errors, slow performance, incorrect tests, etc.), please

Is there a problem? Contact a site administrator.

©, all rights reserved.