adplus-dvertising
frame-decoration

Question

What is the output of this program?
void main()
{
    int x=0;
    for(;;)
    {
        if(x==3)
            break;
        printf("%d ",++x);
    }

}

a.

1 2 3

b.

0 1 2 3

c.

1 2

d.

Compilation Error

Posted under C Programming

Answer: (a).1 2 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 this program?