using System;
public class Test{
public Test(){
}
public int M1(int x,ref int y,out int diff)
{
diff=x-y;
y=y+3;
Console.WriteLine("M1");
return y;
public class Program
public static void Main()
Test t =new Test();
int x=4;
int y=2;
int diff;
int num=t.M1(x,ref y,out diff);
Console.WriteLine("Hello World-->y value is-->"+num+" and out val of diff is -->"+diff);