repl.it
@kironroy/

enums

C#

No description

fork
loading
Files
  • main.cs
  • main.exe
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
using System;

namespace EnumApplication {
   class EnumProgram {
      enum Days { Sun, Mon, tue, Wed, thu, Fri, Sat };

      static void Main(string[] args) {
         int WeekdayStart = (int)Days.Mon;
         int WeekdayMid = (int)Days.Wed;
         int WeekdayEnd = (int)Days.Sun;
         
         Console.WriteLine($"Monday: {WeekdayStart}");
         Console.WriteLine($"Wednesday: {WeekdayMid}");
         Console.WriteLine($"Sunday: {WeekdayEnd}");
         Console.ReadKey();
      }
   }
}