+ 1
What the error Or problem you are facing...?
+ 1
In loop, use semi colon ; (not comma,) to separate blocks..
edit:
#include <iostream>
using namespace std;
int main(){
int n;
cin >> n; //size of the array
int *nums = new int[n];
for (int i=0; i<n; i++) { // edit
cin >> nums[i];
}
int max = nums[0];
for(int i=0; i<n; i++) {
if(nums[i]>max)
max = nums[i];
}
cout << max;
}