xxxxxxxxxx
class Program
{
static void Main()
{
int normalParam = 5;
int outParam;
// Normal parameter
MethodWithNormalParam(normalParam);
Console.WriteLine("Normal parameter outside the method: " + normalParam); // Output: 5
// out parameter
MethodWithOutParam(out outParam);
Console.WriteLine("out parameter outside the method: " + outParam); // Output: 10
}
static void MethodWithNormalParam(int x)
{
x = x * 2; // Changes made to x inside the method do not affect the original variable
}
static void MethodWithOutParam(out int y)
{
y = 5;
y = y * 2; // Changes made to y inside the method are reflected in the original variable
}
}