how to iterate through array in c++

C++
for(int i=0; i<n; i++)
  cout<<array[i]<<" "
  cout<<endl;
Source

Also in C++: