Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Finding of the 4 larger (bigger) numbers from the list
like{1245,4587,2145,1163,29987,65783.....}

Answer Posted / santhosh

int Max = 4;
List<int> lst = new List<int>(new int[] { 1, 12,
2, 11, 15, 3, 14, 4, 5, 6, 7, 8, 9, 10 });
lst.Sort();
if (Max <= lst.Count)
Console.WriteLine(string.Format("The {0} th
Maximum value is {1}.", Max, lst[lst.Count - Max]));
else
Console.WriteLine(string.Format("This list
contain less items. So you could not find the {0}th highest
value from the list.", Max));

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between multiple inheritance and multilevel inheritance?

1108


What is multilevel inheritance explain with example?

1091


What is polymorphism and example?

983


What is overriding in oop?

995


What is and I oop mean?

1111


What exactly is polymorphism?

1076


What is inheritance and how many types of inheritance?

1043


Why do we need polymorphism in c#?

1100


What are the advantages of polymorphism?

979


just right the logic of it 1--> If few people are electing then every time ur candidate should win 2--> arrange books in box, if box carry weight == books weight then take another box..... find the no of box required.

6880


can inline function declare in private part of class?

4306


What is encapsulation c#?

1015


Can we have inheritance without polymorphism?

975


What is object and class in oops?

1009


Get me a number puzzle game-program

2183