First take the input from user n i.e., size of an array.
Take n elements of an array as input from user.
Sort the array in ascending order.
Take the last element of an array as max.
Take the second last number as runner-up.
again, for loop is used so that to check whether the max number is repeated or not.
First take the input from user n i.e., size of an array. Take n elements of an array as input from user. Sort the array in ascending order. Take the last element of an array as max. Take the second last number as runner-up. again, for loop is used so that to check whether the max number is repeated or not.