#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;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: