/*
3. Find the Maximum Element in an Array
Problem Statement: Given an array of integers, find the maximum element.
*/
using System;
public class FindMaxElement
{
public static int FindMax(int[] arr)
int max = arr[0];
foreach(int num in arr)
if (num > max)
max = num;
}
return max;
public static void Main()
int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
int max = FindMax(arr);
Console.WriteLine("Maximum Element: " + max);