I was practicing my C skills online. And I got a question like:
What is the output of this program?
void main(){
int i;
for(i=1;i++<=1;i++)
i++;
printf("%d",i);
}
The answer was 5. But I thought the for loop would execute endlessly. As the i will be incremented on each iteration and i will be never less than or equal to 1. how come 5 will be the output of this program?