Vidyalelo
C# Programming · Q155

Classes and Objects in C Sharp

Programming · C# Programming · question 155

Q155

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);

A.
Compile time error
B.
25
0
C.
216
0
D.
216
25
Answer

Answer: Option D

Solution

Answer: Option D
No explanation is given for this question Let's Discuss on Board