Answer Posted / vili
// this deals with negative numbers as well
int getSecondMax( int* pArray, int nSize )
{
int nMax = pArray[0];
int n2ndMax = pArray[0];
for ( int i = 1; i < nSize; i++ )
{
if ( nMax < pArray[i] )
{
n2ndMax = nMax;
n2ndMax = pArray[i];
}
}
return n2ndMax;
}
| Is This Answer Correct ? | 6 Yes | 22 No |
Post New Answer View All Answers
What you know about structures in C++?
How can a struct in c++ differs from a struct in c?
What is microsoft c++ redistributable?
Is c++ low level?
What are the steps in the development cycle?
Explain the different access specifiers for the class member in c++.
What is the syntax for a for loop?
What are c++ variables?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
Explain mutable storage class specifier.
What is the use of seekg in c++?
What is token c++?
What is endl?
can any one help to find a specific string between html tags
which is changed to a sting..
weather.html looks (for location) is
Why c++ is faster than java?