Tuesday, October 21, 2008

What will be printed when the sample code above is executed?

int x = 0;
for ( ; ; )
{
if (x++ == 4)
break;
continue;
}
printf("x=%d\n", x);

Choice a: x=0
Choice b: x=1
Choice c: x=4
Choice d: x=5
Choice e: x=6

No comments: