There are several issues in your Code
First: You missed to show the user what values he shoud enter.
And you also do no range check.
Second: You missed to declare and allocate space for arr.
You could use a vector of size (n) here.
Third: Your bubblesort does not work correct.
On Wikipedia you can find pseudocode which in C ++ gives something like this:
for (int c=arr.size(); c>1; --c) {
for (int i=0; i<c-1; ++i) {
if (arr[i] > arr[i+1]) {
swap(arr[i], arr[i+1]);
} } }