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 / adnan sheikh

int SecondMax(int Array[], int ALength)
{
int Fmax,Smax;
Fmax=Smax=Araay[0];
for (int i = 0; i < ALength; i++)
{
if (Array[i] > Smax){
if (Array[i] < Fmax){
Smax = Array[i];
}
else{
Smax = Fmax;
Fmax = Array[i];
}
}
}
return Smax;
}

Is This Answer Correct ?    9 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pointer with example?

1264


Give an example of run-time polymorphism/virtual functions.

1008


What is private public protected in c++?

1053


What is a tuple c++?

1018


What's the "software peter principleā€?

1152


How do you clear a map in c++?

1129


How do you add an element to a set in c++?

999


Explain class invariant.

1069


Explain the properties and principles of oop.

1032


When should we use multiple inheritance?

1052


Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement

1190


What is the outcome of cout< a) 16 b) 17 c) 16.5

1020


What is jump statement in C++?

1143


What is boyce codd normal form in c++?

1160


What are activex and ole?

1060