Code:

int Max(int a[], int n)
{
   int temp = a[0];
   for(int i=1;i<n;i++)
   if(temp<a[i])
      temp=a[i];
   return temp;
}