second largest number logic
Input size and elements in array, store it in some variable say size and arr .
Declare two variables max1 and max2 to store first and second largest elements. ...
Iterate though all array elements, run a loop from 0 to size - 1 .