Not passing the third test case

#include<bits/stdc++.h>
using namespace std;
//print maximum number
int printmax(int arr[],int n){
int max=0;
for(int i=0;i<n;i++){
if(arr[i]>max){
max=arr[i];
}
}
return max;

}
int main(){
unsigned long long int n;
cin>>n;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
cout<<printmax(arr,n)<<endl;
return 0;
}

Hey Shashank, can you please mention the problem’s name also and copy your code on ide save it and share that link. One more thing is if all the elements are -ve in the array your max variable will never update and always remain 0.