Enumerations Flashcards
1
Q
Enumeration (or enum) is a user defined data type in C.
A
True
2
Q
The keyword ‘enum’ is used to declare new enumeration types in C
A
True
3
Q
enum day {Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday};
Given the enumeration definition above, what is the value of Sunday?
A
0
4
Q
enum day {sunday = 1, monday, tuesday = 5, wednesday, thursday = 10, friday, saturday};
Given the enumeration definition above, what is the value of saturday?
A
12
5
Q
Two enum names cannot have same value
A
False
6
Q
enum state {working, failed};
enum result {failed, passed};
If the above enumerations are in the same scope, this source code would compile with no errors.
A
False