Question: Using the enumeration type in C# , what will the output be for the following segment of code: public enum Season { Spring, Summer, Autumn,

Using the enumeration type in C#, what will the output be for the following segment of code:
public enum Season
{
Spring,
Summer,
Autumn,
Winter
}
public class EnumConversionExample
{
public static void Main()
{
Season a = Season.Autumn;
Console.WriteLine($"Integral value of {a} is {(int)a}");
var b =(Season)1;
Console.WriteLine(b);
var c =(Season)4;
Console.WriteLine(c);
}
}
Select one:
a.
Integral value of Autumn is 2
Summer
4
b.
Integral value of Autumn is 2
1
4
c.
Integral value of Autumn is 3
Summer
4
d.
Integral value of Autumn is 3
Summer
3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!