Vidyalelo
C# Programming · Q136

Miscellaneous in C Sharp

Programming · C# Programming · question 136

Q136

What will be the output of the following C# code snippet? unsafe static void Main() int a = 5; int b = 5; int c = 5; int*[] ptr = new int* [3]; ptr[0] = &a; ptr[1] = &b; ptr[2] = &c; for (a = 0; a < 3; a++) c += *ptr[a]; Console.WriteLine(c); Console.ReadLine();

A.
5 10
B.
10 20
C.
Compile time error
D.
5 10 20
Answer

Answer: Option D

Solution

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