+ 3
You are not initializing memory to nums pointer. And you are taking only single input n; not taking array values....
11th Dec 2022, 8:26 AM
Jayakrishna 🇼🇳
+ 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
11th Dec 2022, 8:57 AM
Jayakrishna 🇼🇳