Tuesday, August 17, 2010

Sample program to understand enum.


Write a sample program to understand enum.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Enums
{
    class Program
    {
        enum Days { sat, sun, mon, tue, wed, thu, fri };
        static void Main(string[] args)
        {
            Console.WriteLine("{0}",(int)Days.sun);
            Console.ReadLine();
        }
    }
}

No comments:

Post a Comment