static int Read(int[]arr) { int First = arr[0]; int Second = arr[0]; int third = arr[0]; for (int i = 0; i < arr.Length; i++) { Console.Write("The Enterd "+i.ToString() +":"); arr[i] = int.Parse(Console.ReadLine()); if (arr[i] > First) { First = arr[i]; } } for (int j = 0; j < arr.Length; j++) { if (arr[j] > Second && First > arr[j]) { Second = arr[j]; } } for (int k = 0; k < arr.Length; k++) { if (arr[k] > third && Second > arr[k]) { third = arr[k]; } } return third; } static void Main(string[] args) { int[] v = new int[5]; Console.WriteLine(Read(v)); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)