First 5 errors happen because you can only declare static arrays of constant size ( int arr[5]; is fine, but int n = 5; int arr[n]; is not. Either dynamically allocate the memory yourself (int* arr = newint[n];) or use a vector.
The last error is because there are several overloads of sqrt, but none of them take an integer argument, so the compiler doesn't know which to use. You could use sqrt( float(n) ) or sqrtf(n) but the best solution would be p*p<=n as sqrt is much slower than multiplication. Also note the <=. Otherwise you'll get 4 as a prime.