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?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.