enum EditMenu
{
Create=10,
Delete=20,
Add=30,
Update=40
};
using System;
namespace ConsoleApplication1
{
enum EditMenu
{
Create=10,
Delete=20,
Add=30,
Update=40
};
class Program
{ enum Days { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday };
static void Main(string[] args)
{
int favDay = (int)Days.Sunday;
Console.WriteLine("My favorite day is {0} = {1}", Days.Sunday,favDay);
Console.WriteLine("The value of enum ADD is = "+(int)EditMenu.Add);
//Iterating through an enum
Console.WriteLine("Iterating through an enum \n\n");
foreach (Days d in Enum.GetValues(typeof(Days)))
{
Console.WriteLine(d.ToString());
}
Console.ReadLine();
}
}
}