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
Why is it so that we can have virtual constructors but we cannot have virtual destructors?
how to get the oracle certification? send me the answer
What is destructor example?
Why polymorphism is used in oops?
Give two or more real cenario of virtual function and vertual object
What are two types of polymorphism?
What is encapsulation example?
What is the importance of oop?
2. Give the different notations for the class.\
What are the types of abstraction?
What is the point of polymorphism?
Prepare me a program for the animation of train
Why is abstraction needed?
What is destructor give example?
Write a program to reverse a string using recursive function?