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
What is difference between multiple inheritance and multilevel inheritance?
What is multilevel inheritance explain with example?
What is polymorphism and example?
What is overriding in oop?
What is and I oop mean?
What exactly is polymorphism?
What is inheritance and how many types of inheritance?
Why do we need polymorphism in c#?
What are the advantages of polymorphism?
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.
can inline function declare in private part of class?
What is encapsulation c#?
Can we have inheritance without polymorphism?
What is object and class in oops?
Get me a number puzzle game-program