CodePudding user response:
Dead cycle, jump out the for loop, nature is not perform printf,I=1; Meet the I & lt;=101, then the sum=sum + I;
Then the second time, I=(2 * I) - 1; I=(2 * 1) - 1=1; This time is back to the first step,
So I have been 1, no more than 101, nature will not jump out of the loop,
CodePudding user response:
I=(2 * I) - 1, equal to 1 at the beginning, I perform this sentence after or equal to 1, the infinite loopCodePudding user response:
Are you require all the odd and less than 101? Can change to the for (I=0; I & lt;=101; I +=2)CodePudding user response:
death cycle!CodePudding user response:
Debugging debugging debuggingCodePudding user response: