C++ Code Example: while-loop through an array to output the content

#include <iostream>
using namespace std;

int main() {
    int myArray[] = {4, 8, 1, 56, 73, 36, 99, 21};
    int myArrayLength = sizeof(myArray) / sizeof(*myArray);
    int i = 0;

    while (i < myArrayLength) {
        cout << myArray[i] << endl;
        i++;
    }
}
Output
4
8
1
56
73
36
99
21