Array target-sum triplets

https://ide.codingblocks.com/s/49736

this is not showing output in 2nd test case. wht is the error ?

Hy Yukti, the code you have written for sort function is wrong. Here i have corrected your code for sort() you can refer this

void sort(int ar[],int n)
{
    int temp;
    for(int i=0;i<n-1;i++)
    {
        for(int j=1;j<n;j++)
        {
            if(ar[i]>ar[j])
            {
                temp=ar[i];
                ar[i]=ar[j];
                ar[j]=temp;
            }
        }
    }
}