class PassByReference
{
void Input()
{
int a;
int b;
a = Convert.ToInt32(Console.ReadLine());
b = Convert.ToInt32(Console.ReadLine());
System.Console.WriteLine("Before Increment Inside Input \n a=" + a + " \n b =" + b);
Increment(ref a,ref b);
System.Console.WriteLine("After Increment Inside Input \n a=" + a + " \n b =" + b);
}
void Increment(ref int a, ref int b)
{
a = a * 100;
b = b * 500;
System.Console.WriteLine("Inside Increment \n a=" + a + " \n b =" + b);
}
public static void Main()
{
PassByReference o = new PassByReference();
o.Input();
Console.ReadLine();
}
}
No comments:
Post a Comment