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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you declare an array of three function pointers where each function receives two ints and returns a float?

789


code for replace tabs with equivalent number of blanks

1649


string reverse using recursion

1823


which is an algorithm for sorting in a growing Lexicographic order

1405


What does sizeof function do?

629






Who developed c language and when?

596


Whats s or c mean?

605


Are the expressions * ptr ++ and ++ * ptr same?

677


How do you view the path?

675


How can I convert a number to a string?

616


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

681


How can I check whether a file exists? I want to warn the user if a requested input file is missing.

664


Can we access array using pointer in c language?

652


Is that possible to store 32768 in an int data type variable?

700


What is meant by high-order and low-order bytes?

663