Home » C# Programming » Enumerations

Which of the following statements is correct about the C#.NET code snippet given below? enum per { married, unmarried, divorced, spinster } per.married = 10; Console.WriteLine(per.unmarried);

Correct Answer: The program will report an error since an enum element cannot be assigned a value outside the enum declaration.

← Previous Question Next Question→

More Questions from Enumerations

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion