> Can anyone explain this C++ code?

Can anyone explain this C++ code?

Posted at: 2014-12-18 
include

#include

main()

{

int x=2,y=2;

while(x>=5,y>=3)

{

printf("\n%d\t%d",++x,++y);

}

getch();

}

First, that's C, not C++.

It's not very good C, either. The while statement has a comma expression in it, that's legal--but useless. The comma operator evaluates both arguments, left first and then right, and returns the value of the right argument.

So that program will ignore the test of the variable x and loop so long as y is greater than 3.

Since y is less than 3 initially, the loop body never runs, and the only thing that program does that's visible to the outide world is a getch() call.

#include

#include

main()

{

int x=2,y=2;

while(x>=5,y>=3)

{

printf("\n%d\t%d",++x,++y);

}

getch();

}