Home / C# Programming / Enumerations :: Discussion

Discussion :: Enumerations

  1. Which of the following is the correct output for the C#.NET code snippet given below?

    enum color: int 
    {   
        red,  
        green,  
        blue = 5,  
        cyan,  
        magenta = 10,   
        yellow 
     }
     Console.Write( (int) color.green + ", " );     
     Console.Write( (int) color.yellow );

     

  2. A.

    2, 11

    B.

    1, 11

    C.

    2, 6

    D.

    1, 5

    E.

    None of the above

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question.


Be The First To Comment