I am getting one test case as wrong.tried a lot but not getting mistake . can u pls help

#include
using namespace std;
int main()
{
int N;
cin>>N;
long long int maxval=0;
if(N>=0){
long long int a[N];
for(int i=0;i<N;i++){
cin>>a[i];
}
for(int i=0;i<N;i++){
if(a[i]>maxval){
maxval=a[i];
}
}
cout<<maxval;
}
cout<<"\n";
return 0;
}

hello @mokshi.14

dont intialise maxval variable with 0 as number can be negative as well.

initilalise maxval with one of the array element and then try to submit again.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.