logo CodeStepByStep logo

ParameterMystery1

Language/Type: C# parameters

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

public class ParameterMystery1
{
    public static void Main()
    {
        int x = 9;
        int y = 2;
        int z = 5;

        Mystery(z, y, x);
        Mystery(y, x, z);
    }

    public static void Mystery(int x, int z, int y)
    {
        Console.WriteLine(z + ", " + (y - x));
    }
}
line 1
line 2

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.