TCS Coding Problem 16

3 comments on “TCS Coding Problem 16”


  • Sadique Gametor

    #include
    int main()
    {
    int n;
    scanf(“%d”,&n);
    int b[n],i,j,temp;
    for(i=0;i<n;i++)
    {
    scanf("%d",&b[i]);
    }
    for(i=0;i<n;i++)
    {
    for(j=i+1;j<n;j++)
    {
    if(b[i]<b[j])
    {

    temp=b[i];
    b[i]=b[j];
    b[j]=temp;
    }
    }
    }
    printf("%d",b[1]);
    return 0;
    }