Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Find the second maximum in an array?

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


Please Help Members By Posting Answers For Below Questions

Is c the same as c++?

1009


What is the basic concept of c++?

1013


How does com provide language transparency?

1010


Evaluate !(1&&1||1&&0) a) Error b) False c) True

1210


Explain the pure virtual functions?

1126


What is a null object in c++?

1234


Using a smart pointer can we iterate through a container?

1084


What does std mean in c++?

1128


Should I learn c or c++ first?

1127


Briefly describe a B+ tree. What is bulk loading in it?

1343


how to explain our contribution in the project?

3704


What is pointer in c++ with example?

1075


Describe the advantage of an external iterator.

1042


Comment on local and global scope of a variable.

1163


How do you declare A pointer to a function which receives nothing and returns nothing

1237