fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int arr[3];
  5.  
  6. //initialize the first two elements of the array
  7. arr[0] = 1;
  8. arr[1] = 2;
  9.  
  10.  
  11. //print all elements of array
  12. printf("arr[0]: %d\n", arr[0]);
  13. printf("arr[1]: %d\n", arr[1]);
  14. printf("arr[2]: %d\n", arr[2]);
  15.  
  16. return 0;
  17. }
  18.  
Success #stdin #stdout 0s 4344KB
stdin
Standard input is empty
stdout
arr[0]: 1
arr[1]: 2
arr[2]: 0