Enumerations

Q1: Which of the following statements is correct about the C#.NET code snippet given below?
int a = 10; 
int b = 20; 
int c = 30;
enum color: byte
{
    red = a, 
    green = b,
    blue = c 
}

A Variables cannot be assigned to enum elements.

B Variables can be assigned to any one of the enum elements.

C Variables can be assigned only to the first enum element.

D Values assigned to enum elements must always be successive values.

E Values assigned to enum elements must always begin with 0.

ANS:A - Variables cannot be assigned to enum elements.

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.