Finding of the 4 larger (bigger) numbers from the list
like{1245,4587,2145,1163,29987,65783.....}
Answer / 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 |
What is encapsulation in simple terms?
What is the difference between a mixin and inheritance?
Conversion from a basic type to a class type may be achieved using______________
Why do pointers exist?
What is encapsulation and abstraction? How are they implemented in C++?
0 Answers Agilent, ZS Associates,
What is encapsulation in oop?
what is polymorpsim? what are its types?
What is destructor oops?
What is multidimensional array?
What is OOPS and How it is different from Procedural Programming ?
23 Answers HP, Infosys, Thyrocare,
What are the benefits of polymorphism?
What is class in oop with example?