0

code:

namespace Mulitple
{
    public class Correction
    {
        public static void Main()
        {

            int x = 3;
            Calculate(x * 2, x);
        }

        public void Calculate(int x, int y)
        {
            int output = 0;
            if (y >= 0)
            {
                output = x + (x / y);
                Calculate(x - 2, y - 1);
            }
            Console.WriteLine(ouput);

        }
    }
}

Why is this error occurring?

Error CS0120 An object reference is required for the non-static field, method, or property Correction.Calculate(int, int) Error CS0103 The name 'ouput' does not exist in the current context Mulitple

  • I'm sure you can find the solution to CS0103 yourself. It's very obvious. If it isn't to you, can you show the line of code where you declare a variable, field, or property named `ouput`? – DiplomacyNotWar Apr 19 '22 at 02:56

0 Answers0