#include <stdio.h>
int main()
{
    char c;
    char d[10000];
    int i = 0, nl = 0,ll = 0,k = 0;
    int maxi = 0;
    while((c=getchar()) != EOF){
        d[i]=c;
        if(c == '\n'){
            ++nl;
            ll = i - k; //line length
            k = i;
            if(maxi<=ll){
                maxi=ll;
                printf("%d",maxi); //**(1)**
            }
        }
        ++i;
    }
    // printf("%d",maxi); **(2)**
}
why is the variable not assigned the value at position (2) of the program? it only prints in position (1)?
 
    