My C++ Quiz

The ultimate place to learn C++!

Question #77: What gets printed?

01 #include <iostream>
02
03 int main()
04 {
05    for (int i = 0; i < 4; ++i)
06    {
07       switch (i)
08       {
09          case 0  : std::cout << "0";
10          case 1  : std::cout << "1"; continue;
11          case 2  : std::cout << "2"; break;
12          default : std::cout << "D"; break;
13       }
14       std::cout << ".";
15    }
16    return 0;
17 }