write a method for an array in which it can display the
largest n next largest value.



write a method for an array in which it can display the largest n next largest value...

Answer / akshatgarg

well there are many methods one simple method i
Find the largest.
Find the smallest.
replace largest by smallest-1
then again search for the largest.

Now this time u will get the second largest number.

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More C Interview Questions

What are dangling pointers in c?

0 Answers  


What is #pragma statements?

0 Answers  


implement OR gate without using any bitwise operator.

1 Answers   Alcatel, Wipro,


What is s or c?

0 Answers  


Explain is it better to bitshift a value than to multiply by 2?

0 Answers  






What is the general form of function in c?

0 Answers  


What is this pointer in c plus plus?

0 Answers  


Do you know the use of fflush() function?

0 Answers  


What are enumerated types?

0 Answers  


What is the difference between exit() and _exit() function in c?

0 Answers  


hello friends what do u mean by BUS ERROR i got this error while i am doing my program in DATA STRUCTURES

2 Answers   Wipro,


What is the difference between typedef and #define?

0 Answers  


Categories