Finding of the 4 larger (bigger) numbers from the list
like{1245,4587,2145,1163,29987,65783.....}



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

Post New Answer

More OOPS Interview Questions

i hav very low percentage in 12th n BSCwhich is around 50.......coz it was just imposed on me 2 b a science graduate,nw m doin MCA n hav aggregate 74% ....what shud i answer if company's HR ask me about dis much low previous percentage??????

3 Answers   Infosys,


What is static modifier?

0 Answers  


If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

0 Answers  


Prepare me a program for the animation of train

0 Answers  


who is the founder of c++?

15 Answers   Hexaware, ONGC,






Why is oop useful?

0 Answers  


Can we have a private virtual method ?

8 Answers   Ness Technologies,


What is object in oop?

0 Answers  


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

0 Answers  


What is the purpose of polymorphism?

0 Answers  


Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.

1 Answers  


Have you ever interfaced with a database?

2 Answers   IBM,


Categories