fork download
  1. #include <iostream>
  2.  
  3. int main(){
  4. int x[10] = {5,8,1,2,4,6,7,1,0,9};
  5.  
  6. std::cout << "Element Value" << std::endl;
  7. for(int i = 0; i < 10; i++) {
  8. std::cout << " " << i << " " << x[i] << std::endl;
  9. }
  10.  
  11. std::cout << "size of array: " << sizeof(x) << std::endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Element  Value
    0     5
    1     8
    2     1
    3     2
    4     4
    5     6
    6     7
    7     1
    8     0
    9     9
size of array: 40