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 inheritance in oop?
What is static in oop?
What is abstraction encapsulation?
How can you overcome the diamond problem in inheritance?
2. Give the different notations for the class.\
what is graphics
What is and I oop mean?
What causes polymorphism?
what are the realtime excercises in C++?
What is oops and its features?
What exactly is polymorphism?
class type to basic type conversion
Can a destructor be called directly?
What is destructor example?
What is encapsulation and abstraction? How are they implemented in C++?