RosettaCodeData/Task/Loops-Foreach/C/loops-foreach-1.c
2023-07-01 13:44:08 -04:00

10 lines
206 B
C

#include <stdio.h>
...
const char *list[] = {"Red","Green","Blue","Black","White"};
#define LIST_SIZE (sizeof(list)/sizeof(list[0]))
int ix;
for(ix=0; ix<LIST_SIZE; ix++) {
printf("%s\n", list[ix]);
}