Hi All,

Given an array of numbers, I want to find out the 2nd largest number in an array. Can anyone help me to solve the problem?

Any help in terms of logic or code would be useful.


Iterate through the array keeping track of two largest so far.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.