Output enum element value : Enum : Data Type C# Examples


C# Examples » Data Type » Enum »

 

Output enum element value









    
using  System;

enum  Color
{
        red,
        green,
        yellow
}

public  class  MainClass
{
        public  static  void  Main()
        {
                Color  c  =  Color.red;
                
                Console.WriteLine("c  is  {0}",  c);
        }
}
    
   
  
   



Output

c is red


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Enum