C# Programming - Enumerations - Discussion

Discussion Forum : Enumerations - General Questions (Q.No. 8)
8.
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);
The program will output a value 11.
The program will output a value 1.
The program will output a value 2.
The program will report an error since an enum element cannot be assigned a value outside the enum declaration.
The enum elements must be declared private.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.