#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
int x=0;
int y=0;
while (x<15)y++,x+=++y;
printf ("%i %i",x, y);
getchar ();
getchar ();
return 0;
}
I don't know why x is 20 and y is 8 at the end. Please explain it step by step.
y++,x+=++y;is pretty horrible code; is this homework?