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 second largest element in array w/o using sorting
techniques? use onle one for loop.

Answer Posted / guest


max = 2ndmax= array[0];
for (i=0;i,length;i++)
{
if (array[i]>max)
{
2ndmax=max;
max=array[i];
}
}
return 2nd max

Is This Answer Correct ?    40 Yes 74 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the binary height balanced tree?

1191


What oops means?

1001


What kind of structure is a house?

1048


How can you determine the maximum value that a numeric variable can hold?

1235


find the sum of two matrices and WAP for it.

1141


How can this be legal c?

1089


What is the difference between memcpy and memmove?

1031


If one class contains another class as a member, in what order are the two class constructors called a) Constructor for the member class is called first b) Constructor for the member class is called second c) Only one of the constructors is called d) all of the above

1066


What is the purpose of sprintf?

1140


Why do we need functions in c?

1024


explain what is fifo?

1078


Is c easier than java?

1081


Create a simple code fragment that will swap the values of two variables num1 and num2.

1290


What is class and object in c?

1124


What is variable and explain rules to declare variable in c?

1094