What will be printed out as a result of the following code execution:
class MyClass
         static void Main() 
              int a = 1, b = 2;
              change(ref a, ref b);   
              Console.WriteLine ("a=" + a + ", b=" + b);   

      private static void change(ref int a, ref int b) 
            int c = a; 
            a = b; 
            b = c; 

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
C# quizzes
Sign Up Now
or Subscribe for future quizzes