Vidyalelo
C# Programming · Q117

Miscellaneous in C Sharp

Programming · C# Programming · question 117

Q117

What will be the output of the following C# code snippet? class UnsafeCode unsafe static void Main() char[] arr = 'A', 'B', 'C', 'D', 'E' ; fixed (char* P = arr) int i; for (i = 0 ;i < 5 ;i++) if (*P % 2 == 0) ++*P; else (*P)++; Console.WriteLine(arr); Console.ReadLine();

A.
ACCEE
B.
FBCDE
Answer
C.
BBDDF
D.
BBCEE

Answer: Option B

Solution

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