Class ReferenceDemo{ public void swap(ref int a,ref int b) { int c; c=a; a=b; b=c; MessageBox.Show("A="+a.toString() + "B=" + b.toString()); }}private void button1_click(Object sender,EventArgs e){ ReferenceDemo obj=new ReferenceDemo(); int x,y; x=10; y=20; obj.swap(ref x,ref y); MessageBox.Show("X=" + x.toString() + "Y=" + y.toString());}