Find a Nth highest or lowest integers in a given series of integers using C#

Rajnilari2015
Posted by Rajnilari2015 under C# category on | Points: 40 | Views : 749
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication2

{
class Program

{
static void Main(string[] args)

{

List<int> lstInts = new List<int>() { 1, 206, 34, -4, 590, 61, 78, 8, 9, 180,237 };



int minNum = lstInts.Min(); //lowest number

int maxNum = lstInts.Max(); //highest number



Console.WriteLine("Min = {0} , Max = {1}", minNum, maxNum);



Console.ReadKey(true);

}

}

}


/*
Min = -4 , Max = 590
*/

Comments or Responses

Login to post response