My C++ Quiz

The ultimate place to learn C++!

Question #14: What value for y gets printed in the program below?

#include <iostream>

const int x = 12;

int main(int argc, char** argv)
{
    enum dog
    {
        x = x,
        y
    };

    std::cout << y << std::endl;

    return 0;
}