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

Describe the setting up of my member functions to avoid overriding by the derived class?

1130


Why null pointer is used?

1044


Write about all the implicit member functions of a class?

1058


Define the operators that can be used with a pointer.

1045


What are the basic data types used in c++?

1033


Define stacks. Provide an example where they are useful.

1013


Describe delete operator?

1087


What is the benefit of learning c++?

984


What is the purpose of the "delete" operator?

1055


Can we define function inside main in c++?

1005


What is class and structure in c++?

1172


What is the use of this pointer in c++?

1007


What happens if a pointer is deleted twice?

1268


Is c++ the hardest language?

983


What are the 3 levels of programming languages?

1041