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
What is polymorphism and its type in c++?
How would you use the functions memcpy(), memset(), memmove()?
Does c++ have arraylist?
What are the comments in c++?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
what is data encapsulation in C++?
What is runtime polymorphism in c++?
What is pointer -to-members in C++? Give their syntax?
Why cout is used in c++?
Can we use clrscr in c++?
Why use of template is better than a base class?
Which is not a valid keyword a) public b) protected c) guarded
what are the characteristics of Class Members in C++?
What does it mean to declare a member function as static?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?