Answer the question
In order to leave comments, you need to log in
Why does executing a recursive method in C# add an extra rung on execution?
Greetings. Ladies and gentlemen programmers, please help me to understand the following
:
static void Method(int value)
{
value++;
Console.WriteLine($"A = {value}");
if (value < 5)
Method(value);
Console.WriteLine($"B = {value}");
}
static void Main(string[] args)
{
Method(2);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question