Oh hang on...just have another quick look at this line:
Code:
for ( Y=X; Y>=X; Y--);
There are several things wrong with this line. Try it in a small test program and see if you can find them all, e.g.
Code:
int main()
{
  int X=10, Y;
  for ( Y=X; Y>=X; Y--);
  {
    printf("%d\n",Y);
  }
  return 0;
}
(edit: thought I'd better indent as per my own advice)