I am confused about how the code below works. Why is the output not 10 but 5?
public class Program
{
public void MyFunc(int x){
x = 10;
}
public void Main()
{
int x = 5;
MyFunc(x);
Console.WriteLine(x);
}
}
Thanks a lot.