In above program, compiler treats the three i's as totally different variables, since they are defined in different block. Once the control comes out of the innermost block, the variable i with value 3 is lost, and hence the i in the second printf() refers to i with value 2. Similarly, when the control comes out of the next innermost block, the third printf() refers to the i with value 1. Hence it is clear that scope of of i is local to the block in which it is defined.