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

How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal)

1 Answers   iLantus, Subex,


what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }

20 Answers   Infosys,


how to swap four numbers without using fifth variable?

2 Answers  


Write a C program to perform some of the operation which can be performed using Single linked list

1 Answers   Qualcomm,


how to estimate the disk access time? e.g. the time between read one byte and another byte in the disk.

3 Answers   Google,






WHAT IS HEADER?

8 Answers   ProKarma, TCS,


what is diff between localstatic and globalstatis variable possible 2 use in another file...?

2 Answers   HCL,


What is table lookup in c?

0 Answers  


O,T,T,F,F,S,S,E,N,?,?,?,T,F,F,S,S,E,N

9 Answers   ADP,


What is indirect recursion? give an example?

4 Answers  


which is conditional construct a) if statement b) switch statement c) while/for d) goto

0 Answers  


What is the meaning of ?

0 Answers  


Categories