What will be printed out as a result of the following code's execution?

#include <iostream>

void f(int x) {
    switch(x) {
        case 1:std::cout << 1;
        case default:std::cout << "Default";
        case 2:std::cout << 2;
    }
}

int main() {
    f(1);
    f(2);
    f(3);
    return 0;
}
Explanation
There should be no "case" keyword in in front of the "default" keyword

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback