Enumerations Initialization with calculation : Enum : Data Type C# Examples


C# Examples » Data Type » Enum »

 

Enumerations Initialization with calculation









    
using  System;

enum  Values
{
        A  =  1,
        B  =  2,
        C  =  A  +  B,
        D  =  A  *  C  +  33
}
class  MainClass
{
        public  static  void  Member(Values  value)
        {
                Console.WriteLine(value);
        }
        public  static  void  Main()
        {
                Values  value  =  0;
                Member(value);
        }
}
    
   
  
   



Output

0


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Enum