CodePudding user response:
Defines a function called increment, val, input and output increment, the loop condition is 8 times (I=0 to I=7), loop, the first sentence grammar is an exclusive or, purpose is to realize the input data to add 1; The second sentence grammar and, to determine whether complete,The for loop is the purpose of the input data to add 1, then the output
CodePudding user response:
To consult for (; ; ) loop sentence structure, should be able to understand,CodePudding user response:
The assignment I 0 first and then judge whether the condition is satisfied, in the middle of the meet I 1 is added to itCodePudding user response:
For (initialization statement; Judge the conditional statements; Control condition statement) {} loop body statementsFormat:
1. The first execute initialization statement,
2. Then execute judgment of whether conditional statements, the result is true or false, if it is true, then continue to perform, otherwise the end of the cycle,
3. The execution of the loop body statements,
4. Perform control conditional statements,
5. Return to step 2 and continue, not letter you can debug operation and see for yourself)