using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication30
{
class Program
{
static void Main(string[] args)
{
int[] arr = {52,42,36,89};
int firstmax,seconmax;
firstmax=seconmax=arr[0];
for (int i = 0; i < arr.Length; i++)
{
if (arr[i] > firstmax)
{
seconmax = firstmax;
firstmax = arr[i];
}
else if (arr[i]>seconmax)
{
seconmax=arr[i];
}
}
Console.WriteLine(seconmax);
Console.ReadLine();
}
}
}
==================
output -- 52
--carzy code