Thursday, 21 May 2015

Q41.Enumeration is a process of


(A) Declaring a set of numbers
(B) Sorting a list of strings ,
(C) Assigning a legal values possible for a variable
(D) Sequencing a list of operators
Answer C
An enumeration is a user-defined type whose value is restricted to one of several explicitly named constants(enumerators). Enumeration are defined using keyword: enum.
enum seasons { spring, summer, autumn, winter };
This code is a enum declaration. After declaration, you can define variable of type seasons. And this variable of type seasons can only have one of those 4 values.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.