ExamVeda
Login
Home
Classes and Objects in C Sharp
?

What will be the output of the following C# code?
static void Main(string[] args)
{
    int a = 10 , b = 20;
    Console.WriteLine("Result before swap is: "+ a +" "+b);
    swap(ref a, ref b);
    Console.ReadLine();
}
static void swap(ref int i, ref int j)
{
    int t;
    t = i;
    i = j;
    j = t;
    Console.WriteLine("Result after swap is:"+ i +" "+j);
}

Answer & Solution
Correct Answer: Option B
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.