Current location - Education and Training Encyclopedia - University rankings - Why is the answer to the C language program question like this?
Why is the answer to the C language program question like this?
The output of this question is "#&; \n\n* "instead of" #&; *"。 Its operand is that the beginning of I is equal to 1, so i%5 is equal to 1, so the content in the clause of case 1 is output, that is, the character #, and then I plus 2. The process is as above, this time the output is the character &; After that, I was added to 3 and 4, and the contents of the defult clause were executed twice, that is, two line breaks \ nFinally, I was equal to 5, executed the contents of the case0 clause, and output the character *. After that, the value of I increases to 6, and the for loop exits because the loop condition is not met.