[Solved] Error when calling a function in C# because variable is used in parameter [closed]
Welcome to SO. as you know you cannot have same variable name used in a method here is what you need { int AddNumbers(int num1, int num2) //Here’s where the error comes { int result = num1 + num2; return result; } int num2 = 10; int num3 = 20; AddNumbers(num2, num3); } you can … Read more