declaring array of int

#include <iostream>

int main() {
    const int size = 5;            // Step 1: Declare a constant variable 'size' with a value of 5.
    int myArray[size];              // Step 2: Declare an array named 'myArray' of integers with a size specified by the 'size' variable.

    for (int i = 0; i < size; ++i) {
        myArray[i] = i * 2;         // Step 3: Initialize each element of 'myArray' with the double of its index.
    }

    std::cout << "Array elements: ";

    for (int i = 0; i < size; ++i) {
        std::cout << myArray[i] << " ";   // Step 4: Display each element of 'myArray'.
    }

    return 0;
}