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 array in c++ example?

1126


What does override mean in c++?

1079


To what does “event-driven” refer?

1077


What c++ is used for?

1112


How many types of classes are there in c++?

1053


What is virtual destructor ans explain its use?

1141


Explain differences between new() and delete()?

1108


Write a c program for binary addition of two 8 bit numbers.

4131


What is istream and ostream in c++?

1143


What is the difference between public and private data members?

1192


What is operators in c++?

1017


What are the steps in the development cycle?

1113


Is c++ double?

1050


What is the use of typedef?

1105


What are the stages in the development cycle?

1073