using System; publicclass SecMax ...{ //record the second max number privatestaticint secMax = Int32.MinValue; //does the list has second max number privatestaticbool HasSecMax(int[] list) ...{ int max = list[0]; //get the max number for(int i =1;i < list.Length;i++) ...{ if(list[i] > max) ...{ max = list[i]; } } bool isFound =false; //get the second max number for(int j =0;j < list.Length;j++) ...{ if((list[j] < max) && (list[j] > secMax)) ...{ secMax = list[j]; isFound =true; } } return isFound; } publicstaticvoid Main() ...{ int[] list =newint[]...{1,2,3,4,5,6,7}; if(HasSecMax(list)) ...{ Console.WriteLine("The SecMax number is:"+ secMax); } else ...{ Console.WriteLine("Has no SecMax."); } } }