Q:

For loop format in C

I am wondering how is this program executed at all and does not throw any error.
void main( ) 
{ 
    clrscr();
    int i ; 
    for ( i = 1 ; i <= 5 ; printf ( "\n%c", 65 ) ) ; 
        i++ ;
    getch(); 
} 

The loop goes on printing A forever. The format of for loop is
for(initialize value; test counter; increment value)
{
    do this;
    and this;
    and this;
}

My question is how can printf("\n %c", 65) increment the value?        

A:

The trailing ; after the for() results in i not being incremented inside the for, causing an infinite loop.
This:
for ( i = 1 ; i <= 5 ; printf ( "\n%c", 65 ) ) ; 
    i++ ;

is equivalent to:
for ( i = 1 ; i <= 5 ; printf ( "\n%c", 65 ) ) {} /* Empty loop body. */
i++ ;

The i++ is never reached. To correct, remove the trailing ;. It would be clearer to use the i++ as the iteration expression in the for loop and not the printf() and i does not need to exist outside of the loop body:
for (int i = 1; i <= 5; i++)
{
    printf ( "\n%c", 65 );
}

My question is how can printf("\n %c", 65) increment the value? 

printf() returns the number of characters written so it would be possible to use it to increment i if you wish but it would be neccessary to change the terminating condition to account for \n character:
for (int i = 1; i <= 10; i+= printf("\n%c", 65));

However, this is less clear than the previous suggestion.

