Programming Languages C# Objective
Mar 07, 2013

Which statements is correct about the C#.NET code?

enum per

{

    married, 

    unmarried, 

    divorced, 

    spinster

}

per.married = 10; 

Console.WriteLine(per.unmarried);

Choose the correct answer:
A) The program will output a value 11.
B) The program will output a value 1.
C) The program will output a value 2.
D) The program will report an error since an enum element cannot be assigned a value outside the enum declaration.
Detailed Explanation

Option D is the right answer.

Discussion (0)

No comments yet. Be the first to share your thoughts!

Share Your Thoughts
Feedback