. In LINE B, where we have postfix increment operator i.e. In LINE A, we have prefix increment operator i.e. It falls under the category of definite iteration. The tradition developed, in C, of using post-increment when the expression value is not used, especially in for loops. Since the two types of increment behave the same when the value is ignored, why not just always pre-increment? This is one of the most frequently used loop in C programming. The second for loop uses the “pre-increment” operator where the operand is prefixed with the operator as “++i”. But have you ever wondered, what happens, if you try to increment the value of the iterator from inside the for loop. Pre and Post Increment - Java Example Programs . I would avoid pre-increment and post-increment operators in a while-loop condition as much as possible. Syntax of for loop: for (initialization; condition test; increment or decrement) { //Statements to be executed repeatedly } Flow Diagram of For loop So that you can understand if statement, for loop, while loop and do-while loop syntax easily. For loops, in general, are used for sequential traversal. Definite iterations mean the number of repetitions is specified explicitly in advance. for ( init; condition; increment ) { statement(s); } Here is the flow of control in a 'for' loop − The init step is executed first, and only once. It's not as idiomatic as it is with the for-loop so most people will have to pause and read it carefully to make sure they understand exactly when the while-loop terminates and what the value of the variable will be after the loop. Then you must be wondering why there are two ways to do the same thing. Here a and b are declared as integers and they are assigned to 5 and 2 respectively. ( ++b).So the value of b is first incremented from 2 to 3 and then assigned to c.Hence c becomes 3. Yes, you guessed it right! for (int i=0; i