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

Why is it so that we can have virtual constructors but we cannot have virtual destructors?

3853


how to get the oracle certification? send me the answer

1674


What is destructor example?

602


Why polymorphism is used in oops?

590


Give two or more real cenario of virtual function and vertual object

1858






What are two types of polymorphism?

617


What is encapsulation example?

553


What is the importance of oop?

619


2. Give the different notations for the class.\

1594


What are the types of abstraction?

562


What is the point of polymorphism?

597


Prepare me a program for the animation of train

2007


Why is abstraction needed?

571


What is destructor give example?

608


Write a program to reverse a string using recursive function?

1798