array in c++
#include <iostream>
int main() {
const int SIZE = 5; // Step 1: Declare a constant for the size of the array
int numbers[SIZE]; // Step 2: Declare an array of integers with the specified size
// Step 3: Initialize the array elements using a loop
for (int i = 0; i < SIZE; ++i) {
numbers[i] = i * 2;
}
// Step 4: Access and print the array elements using a loop
std::cout << "Array elements: ";
for (int i = 0; i < SIZE; ++i) {
std::cout << numbers[i] << " ";
}
return 0;
}