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 the difference between ERROR and EXCEPTION?
How long to learn object oriented programming?
There are 2 classes defined as below public class A { class B b; } public class B { class A a; } compiler gives error. How to fix it?
to find out the minimum of two integer number of two different classes using friend function
program in c++ that can either 2 integers or 2 floating point numbers and output the smallest number
what is the basic concept of inheritance?
what is the difference between javap and jad utility
In c++ there is only virtual destructors, no constructors. Why?
Can java compiler skips any statement during compilation time?
Can an interface inherit a class?
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
how to swap to variables without using thrid variable in java?