ExamVeda
Login
Home
Arrays and Strings in C Sharp
?

What will be the output of the following C# code?
static void main(string[] args)
{
    int n = 1;
    method(n);
    console.Writeline(n);
    method1(ref n);
    console.Writeline(n);
}
static void method(int num)
{
    num += 20;
    console.writeline(num);
}
static void method1(ref int num)
{
    num += 20;
    console.writeline(num);
}

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.