using System;
enum Color
{
red,
green,
yellow
}
public class MainClass
{
public static void Main()
{
Color c = Color.red;
// enum values and names
foreach (int i in Enum.GetValues(c.GetType()))
{
Console.WriteLine("Value: {0} ({1})", i, Enum.GetName(c.GetType(), i));
}
}
}