C# Programming - Enumerations - Discussion
Discussion Forum : Enumerations - General Questions (Q.No. 6)
6.
Which of the following will be the correct output for the C#.NET code snippet given below?
enum color : int
{
red = -3,
green,
blue
}
Console.Write( (int) color.red + ", ");
Console.Write( (int) color.green + ", ");
Console.Write( (int) color.blue );
Discussion:
1 comments Page 1 of 1.
Trishant Mishra said:
1 decade ago
By default enum value is increase by one in every time...
So -3
-3+1 = -2
-2+1 = -1
So -3
-3+1 = -2
-2+1 = -1
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers