c++ – Cin taking invalid number of inputs

I assign the variable arrSize with zero ( int arrSize = 0; ) and in next line I take input from user for the variable arrSize. Let’s suppose the user assigns 5 value to the variable.
When I execute my code, Cin is taking only 4 values instead of 5.

But when I only declare the variable ( int arrSize; ) and don’t assign any value to it, then it’s working perfectly fine.

I’m a newbie, can you please explain why is it happening?
Thank You!

Here’s my code:

#include <iostream>

using namespace std;

int main(){
    
    int arrSize = 0;
    int arr(arrSize);
    cout << "Enter the array size: ";
    cin >> arrSize;

    cout << "Enter the elements of the array: ";
    for (int i = 0; i < arrSize; i++){
        cin >> arr(i);
    }

    cout << "Output: " << endl;
    for (int j = 0; j < arrSize; j++){
        cout << arr(j) << endl;
    }


}

Output: