Write a C program to find and print the second largest element in the array.

Example:

To do this we need to cpmare each array element with the largest number (i.e max). If it is greater than ‘max’ then ‘max’ value become second largest (i.e second max) or if the array element is less than max but greater than ‘second max’ then the array element is the second largest element.

Output

If you have any suggestion or doubts then comment below.

Leave a Reply

Close Menu