Question: What is the output of the following program? using System; public static class Parameter Passing { public static void Main() { int a = 4,0

 What is the output of the following program? using System; public

What is the output of the following program? using System; public static class Parameter Passing { public static void Main() { int a = 4,0 = 8, c= 3; Console.WriteLine("a = {0}, b = {1},c = {2}", a, b, c); a= Methodi(cref b); Console.WriteLine("a = {0}, b = {1},c= {2}", a, b, c); Console.ReadLine(): } public static int Methodi(int x, ref int y) { Console.WriteLine("x = {0}, y = {1}", x, y); Method2(ref x, y+4); y= 9; Console.WriteLine("x = {0}, y= {1}", x, y); return 0; } public static void Method2 (refint q, int p) { q=p++; p = 2; Console.WriteLine("p = {0}, q = {1}", p. 9); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!