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 i = 5;
    int j  = 6;
    add(ref i);
    add(6);
    Console.WriteLine(i);
    Console.ReadLine();
}
static void add(ref int x)
{
    x = x * x;
}
static void add(int x)
{
    Console.WriteLine(x * x * x);
}

Answer & Solution
Correct Answer: Option D
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.