#include <stdio.h>

int main() {
    // initialize an array
    int a[6] = {10, 20, 30, 40};

    // initialize the loop variable
    int i;

    for (i = 0; i < 4; i++) {
        // print the element index and the array item
        printf("a[%d] = %d\n", i, a[i]);
    }

    return 0;
}
C compiler by mycompiler.io