C compiler and arrays :     #include <stdio.h>
  
    int main(void){
        double arr[] = { 1.1, 2.2, 3.3, 4.4 };
        int i;
    
        for (i=0; i<=4; i++) {
            printf("%d\n", i);
            arr[i] = 0;
        }
    
    return 0;
    }

Compiling with gcc(c90) gives an infinite loop(1,2,3,4,1,2,3,4...) while compiling with gcc(c99) produces only (0, 1, 2, 3, 4). What can be attributed to the difference?  