Array initialization

#include <stdio.h>
int array[] = {3, 2, 1, 3, 6, 4, 2, 2, 9, 3};
int index;
int main()
{
index = 0;
while (array[index] != 0)
++index;
printf("Number of elements before zero %d\n",
index);
return (0);
}
Related examples in the same category