Home / C# Programming / Enumerations :: Discussion

Discussion :: Enumerations

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

      enum color : int
      {  
           red = -3,  
           green, 
           blue  
      }
       Console.Write( (int) color.red + ", ");    
       Console.Write( (int) color.green + ", ");  
       Console.Write( (int) color.blue );
    

  2. A.

    -3, -2, -1

    B.

    -3, 0, 1

    C.

    0, 1, 2

    D.

    red, green, blue

    E.

    color.red, color.green, color.blue

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment