?
What will be the output of the following C# code?
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);
}
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);
}
Join the Discussion
Login to post a comment or share your explanation.
Login