Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 the Advantages of using macro

0 Answers  


Difference between null pointer and dangling pointer?

7 Answers   GE, Wipro,


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

0 Answers  


what is the difference between exit() and _exit() functions?

2 Answers  


program for following output using for loop? 1 2 3 4 5 2 3 4 5 3 4 5 4 5 5

8 Answers   Infosys,


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?

3 Answers  


char *p="name"; printf(p);

1 Answers  


For what purpose null pointer used?

0 Answers  


When should volatile modifier be used?

0 Answers  


main() { int i=400,j=300; printf("%d..%d"); }

13 Answers   ME,


How can I find leaf node with smallest level in a binary tree?

1 Answers  


/*program to calculate hra,da in salary if salary less than 10000 then hra15%,da13% otherwise hra20%,da18%/*

6 Answers  


Categories