An Array declaration by initializing elements in C++

#include <iostream>

int main() {
    // Declare and initialize an integer array with size 5
    int numbers[5] = {1, 2, 3, 4, 5};

    // Declare and initialize a character array with size 4
    char characters[4] = {'a', 'b', 'c', 'd'};

    // Declare and initialize a double-precision floating-point array with size 3
    double values[3] = {1.5, 2.7, 3.9};

    // Declare and initialize a boolean array with size 2
    bool flags[2] = {true, false};

    // Output array elements
    for (int i = 0; i < 5; ++i) {
        std::cout << "numbers[" << i << "] = " << numbers[i] << std::endl;
    }

    for (int i = 0; i < 4; ++i) {
        std::cout << "characters[" << i << "] = " << characters[i] << std::endl;
    }

    for (int i = 0; i < 3; ++i) {
        std::cout << "values[" << i << "] = " << values[i] << std::endl;
    }

    for (int i = 0; i < 2; ++i) {
        std::cout << "flags[" << i << "] = " << (flags[i] ? "true" : "false") << std::endl;
    }

    return 0;
}