Is there any issue with the code

#include
#include
using namespace std;
int main() {
int n;
cin>>n;
int largest;
if(n >= 0)
{
int arr[n];
for(int i = 0;i<n;i++)
{
cin>> arr[i];
}

largest = arr[0];
for(int i = 0;i<n;i++)
{
	if(arr[i] > -1000000000 && arr[i] < 1000000000)
	{
		if(arr[i] > largest)
		{
			largest = arr[i];
		}
	}		
} 

}
return largest;
}

hi @cs17b010_60782e7cd0491d73 code is correct dont return largest just print it there

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.