fork download
  1. #include <stdio.h>
  2.  
  3. int main (void) {
  4. int x, n;
  5.  
  6. // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
  7. int array[] = {2, 4, 6, 9, 11, 13, 15, 17, 19, 21, 25, 29, 30, 34, 35, 38};
  8. n = sizeof(array) / sizeof(int);
  9.  
  10. for (x=0; x<n; x++) {
  11. printf("%i: %i - ", x, array[x]);
  12. }
  13.  
  14. printf("\nArray's length: %i", n);
  15. return 0;
  16. }
Success #stdin #stdout 0s 2052KB
stdin
Standard input is empty
stdout
0: 2 - 1: 4 - 2: 6 - 3: 9 - 4: 11 - 5: 13 - 6: 15 - 7: 17 - 8: 19 - 9: 21 - 10: 25 - 11: 29 - 12: 30 - 13: 34 - 14: 35 - 15: 38 - 
Array's length: 16