find second largest element in array w/o using sorting
techniques? use onle one for loop.
Answer Posted / guest
max = 2ndmax= array[0];
for (i=0;i,length;i++)
{
if (array[i]>max)
{
2ndmax=max;
max=array[i];
}
}
return 2nd max
| Is This Answer Correct ? | 40 Yes | 74 No |
Post New Answer View All Answers
How do I get an accurate error status return from system on ms-dos?
Write a program for Overriding.
What are 'near' and 'far' pointers?
What is difference between structure and union in c?
What does the file stdio.h contain?
What are the advantages and disadvantages of a heap?
Explain what are preprocessor directives?
When is a void pointer used?
What is a pointer variable in c language?
What does it mean when a pointer is used in an if statement?
to find the closest pair
int far *near * p; means
What is class and object in c?
How can I call a function with an argument list built up at run time?
Can you return null in c?