0

I got this question in C++ interview for the intership. I was really confused and still don't understand why it is working like that. The question was about output of the code below. Right output is 10, but my guess was 1. Can somebody explain this code?

 int a = 1;
    switch(a)
    {
        case 0:
            do{
                case 1:
                a++;
            }while(a < 10);
        break;
    }

0 Answers0