I wanted to have a program that inputs the number of elements in the array, inputs the int variable of the element and outputs the numbers in random order, without repeating the same element twice.
I have no error but sometimes it outputs big numbers i didn't input, thanks in advance.
The way you've created the array on line 10 is only valid if you know the size of the array at compile time. If you only know the size of the array at runtime, fr example after the user enters a value, then you need to dynamically allocate the array using new (and later delete).
On line 16 - y[random] may be an element of the array that hasn't had a value entered yet, so it could have some random garbage value. Which you then store in y[i].
Maybe look into random_shuffle to shuffle the elements in your array after they've been entered.
Line 10 works with some compilers but it isn't standard C++.
As wildblue says, you're swapping the input number with a random number that might not be initialized. You need to input all the numbers first, then shuffle them, then output the shuffled set of numbers.