Given the following declaration and output statement, assume that this has been embedded in a correct program and is run. What is the output?
enum Direction { N = 5, S = 7, E = 1, W };
// ...
cout << W << " " << E << " " << S << " " N << endl;
The output of the given code is 2 1 7 5.
Reason: enum constants are given values as assigned. Unassigned constants increment the previous value by 1.