Array

Programming

This program demonstrates C-style arrays, which are fixed-size collections of elements of the same type.

Implementation

#include <iostream>

int main() {
    int numbers[5] = {1, 2, 3, 4, 5};
    for (int i = 0; i < 5; ++i) {
        std::cout << "Element " << i << ": " << numbers[i] << std::endl;
    }
    return 0;
}

Key Concepts

Output

Element 0: 1
Element 1: 2
Element 2: 3
Element 3: 4
Element 4: 5