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

An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

0 Answers  


How to print all the 26 alphabets in this order in C. AbCdEfGh..... it should print dynamically from a to z and do not print this using pgm like this print("Ab......"); Use loops or anything to print all alphabets

2 Answers   Hexaware,


Why doesnt the call scanf work?

0 Answers  


what is a NULL pointer?

2 Answers  


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

0 Answers  






how to implement stack work as a queue?

2 Answers  


What is the role of && operator in a program code?

0 Answers  


Write a C/C++ program that connects to a MySQL server and checks intrusion attempts every 5 minutes. If an intrusion attempt is detected beep the internal speaker to alert the administrator. A high number of aborted connects to MySQL at a point in time may be used as a basis of an intrusion.

1 Answers  


What is 1d array in c?

0 Answers  


Is there any data type in c with variable size?

0 Answers  


what is dangling pointer?

1 Answers   LG Soft,


what is inline function?

2 Answers  


Categories