.Net > Enumerations > Beginner Next/Skip this question

What would be the output of following code snippet?

using System;

class Program
{
    enum MyColorEnum
    {
        Red,
        Blue,
        Green
    };

    static void Main()
    {
        MyColorEnum value = new MyColorEnum();

        if (value == MyColorEnum.Red)
        {
            Console.WriteLine("Red");
        }
        else if (value == MyColorEnum.Blue)
        {
            Console.WriteLine("Blue");
        }
        else if (value == MyColorEnum.Green)
        {
            Console.WriteLine("Green");
        }
        Console.ReadLine();
    }
}
Answers :
Explaination :
social share share on facebook share on twitter share on google plus share on linkedin
Add Comments :

Login

Register

Next Question