Answer Posted / foreverkushal
int SecondMax(int *Array, int ACount)
{
int Fm = 0, Sm = 0;
for (int i = 0; i < ACount; i++)
{
if (Array[i] > Sm)
{
if (Array[i] < Fm) Sm = Array[i];
else
{
Sm = Fm;
Fm = Array[i];
}
}
}
return Sm;
}
| Is This Answer Correct ? | 31 Yes | 22 No |
Post New Answer View All Answers
Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort
What are the manipulators in c++?
Give example of a pure virtual function in c++?
Where must the declaration of a friend function appear?
What is the arrow operator in c++?
List the special characteristics of constructor.
Why do we use vector in c++?
Write a program using display() function which takes two arguments.
What is DlgProc?
Is c++ fully object oriented?
How do I run c++?
Why do we use using namespace std in c++?
Write down the equivalent pointer expression for referring the same element a[i][j][k][l]?
Write a program to concatenate two strings.
What will happen if a pointer is deleted twice?