October 18th, 2012, 06:56 AM
for(i = 0; i <= 10; ++i);
printf("%d ", i);
In the above program , we are pre-incrementing i, even though the output is 1-10 , which is the case for post increment.Why?? I mean why the output is same whether we pre-increment or post - increment the i's value.
for(i = 1; i <= 5;printf("\n%d ", i))
}// why the output is 2 3 4 5 6..... it would have to first initialize the value i then compare , then print and then it would have to enter the loop , where the value of i would get incremented.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!