using System;
class Program
{
static void Main()
{
int[] array = { 5, 3, 9, 2, 7 };
int max = int.MinValue;
foreach (int num in array)
{
if (num > max)
{
max = num;
}
}
Console.WriteLine("Maximum Element: " + max);
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: