0

C# question any help is appreciated. How to fix the error and what is the output of the code?

using System; namespace test { class MainClass { static int Test(out int x,int y=4){ x=6; return x*y; } static void Main(string []args){ int a; int z = Test (out a); Console.WriteLine (a+z); } Console.ReadLine(); invalid token '(' in class,struct,or interface member declaration } }

28th Jan 2020, 5:49 PM
Franki
1 Answer
+ 1
Not an expert at C#, but you are calling a function outside of main?
28th Jan 2020, 6:37 PM
Gevork Bagratyan