loop through array c++

C++
for(int i = 0; i < 4; i++) {
  cout << cars[i] << "\n";
}#include <iostream>
#include <array>

int main()
{
	int aNumbers[] = { 0, 1, 2, 3, 4, 5 };
	int count = 0;	
	
	for (int aNumber : aNumbers)
	{		
		std::cout << "Element "<< count << " : " << aNumber << std::endl;
		count++;
	}
}
Source

Also in C++: