+ 3
You are not initializing memory to nums pointer.
And you are taking only single input n; not taking array values....
+ 2
To resolve it initialize memory for nums n pointers. Do you know how?
This is a way :
int *nums = new int[n]; // now nums pointer array is of length 5.
After it, take n inputs into nums array by a loop;
Then find max. initially set max = 0