Get help on this challenge


Please read this explanation before attempting debugging challenges.

When I run this C code to add the numbers from 1 to 10 I should get 45, but for some reason I get 10. WTF?
Note: 1 to 10 is not the same as 1 through 10.

//By ynori7

int main()
  int sum = 0;
  int x = 1;
  for(x=1; x<10; x++);
  printf("Sum: %d\n", sum);
  return 0;

Downloadable source code can be found here.

You must be logged in to play. Login or register here

Challenge by ynori7.