C#C
C#3y ago
m1tten

❔ Hiya i am new to C# i am having problems with return method

    static void Main(string[] args)
    {
        Console.WriteLine("Hello World!");
        int PlayerPositionX = 5;
        int PlayerPositionY = 5;
        Add(PlayerPositionY, PlayerPositionX);
        Console.WriteLine(PlayerPositionX + " " + PlayerPositionY);
        //it should be both 10 10 but instead only printing 5 5 
    }
    public static int Add(int X, int Y)
    {
        X = X + X;
        Y = Y + Y;

        return X;
        return Y;

    }
thank you so much in advance
Was this page helpful?