#include<stdio.h>
int main()
{
    int a[100],n,i,k,j,max=0,secondMax;
    scanf("%d",&n);
    for ( i = 0; i < n; i++)
    {
      scanf("%d ",&a[i]);
      if(max<=a[i]){
        secondMax=max;
        max=a[i];
      }
      else if( max>a[i] && secondMax<a[i]) {
          secondMax=a[i];
      }
    }
    printf("2nd large: %d",secondMax);

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: