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

Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1057


In which language linux is written?

1184


Write a program to know whether the input number is an armstrong number.

1078


How do you use a pointer to a function?

1037


Can we change the value of #define in c?

969


All technical questions

1935


What is bubble sort in c?

1013


What is c language used for?

941


What will the preprocessor do for a program?

1028


hi send me sample aptitude papers of cts?

2113


Explain how can you determine the size of an allocated portion of memory?

1056


What is the difference between the expression “++a” and “a++”?

1182


What is auto keyword in c?

1168


Why use int main instead of void main?

1075


How do I convert a string to all upper or lower case?

1062