Help plz


how its possible?

The arr array has only 3 elements i.e. 13, 24, 35. You can confirm it by by looping over the elements of the array,

for (const auto& n: arr) {
        cout << n << "\n";
    }
// 13
// 24
// 35

However, if you try to use bracket notation to access elements with higher indices, you may not necessarily see an error thrown. This has to do with how C++ works. In C++, when you are using square bracket notation to access elements of the array/vector, then you are responsible for not trying to use indices which may be out of range. In many other languages e.g. Python, an error will be thrown and program will crash if your index is out of range. In C/C++, the onus is on the programmer to respect the range/bounds. If you go out of bounds, you will see undefined behavior (your output could be gibberish or some other unpredictable behavior). For Example, try running the following code:

for (int i = 0; i < 10; i++) {
        cout << arr[i] << "\n";
    }

When the index i is within bounds, you will see the correct values as expected. When you go beyond the bounds, there are no guarantees. You might see the values 46, 38, 51, 63, 72 or you may not. For even higher indices, you may likely see whatever garbage value is already present at that memory location. Depending on the compiler, you may even get an error or crash.

Related stackoverflow thread,
c++ - Accessing an array out of bounds gives no error, why? - Stack Overflow