fork download
  1. #include <stdio.h>
  2.  
  3. #define NUMBER 60
  4.  
  5. void set_idx(int *v, int n)
  6. {
  7. int i;
  8.  
  9. for(i = 0; i < n; i++)
  10. v[i] = i;
  11. }
  12.  
  13. int main(void)
  14. {
  15. int i;
  16. int a[NUMBER];
  17.  
  18. set_idx(a, NUMBER);
  19.  
  20. for(i = 0; i < NUMBER; i++)
  21. printf("a[%d] = %d\n", i, a[i]);
  22.  
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
a[0] = 0
a[1] = 1
a[2] = 2
a[3] = 3
a[4] = 4
a[5] = 5
a[6] = 6
a[7] = 7
a[8] = 8
a[9] = 9
a[10] = 10
a[11] = 11
a[12] = 12
a[13] = 13
a[14] = 14
a[15] = 15
a[16] = 16
a[17] = 17
a[18] = 18
a[19] = 19
a[20] = 20
a[21] = 21
a[22] = 22
a[23] = 23
a[24] = 24
a[25] = 25
a[26] = 26
a[27] = 27
a[28] = 28
a[29] = 29
a[30] = 30
a[31] = 31
a[32] = 32
a[33] = 33
a[34] = 34
a[35] = 35
a[36] = 36
a[37] = 37
a[38] = 38
a[39] = 39
a[40] = 40
a[41] = 41
a[42] = 42
a[43] = 43
a[44] = 44
a[45] = 45
a[46] = 46
a[47] = 47
a[48] = 48
a[49] = 49
a[50] = 50
a[51] = 51
a[52] = 52
a[53] = 53
a[54] = 54
a[55] = 55
a[56] = 56
a[57] = 57
a[58] = 58
a[59] = 59