adplus-dvertising
frame-decoration

Question

What is the output of the following code?
int main()
{
    int i = 0;
    switch(i)
    {
    case 0 : i++;
    case 1 : i+++2;
    case 2 : ++i;
    }
    pritnf("%d",i++);

    return 0;
}

a.

2

b.

3

c.

4

d.

5

Answer: (b).3

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the following code?