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 #include<stdio.h> int main() { int sum = 0; int x = 1; for(x=1; x<10; x++); { sum+=x; } printf("Sum: %d\n", sum); return 0; }
Downloadable source code can be found here.