Why it is not giving complete output?


Where is the mistake?

Bhavesh, the loop you are using in your code seems incorrect, use this loop instead of wht u have used,
for(int i=0;i<n-2;i++)
{
for(int j=i+1;j<n-1;j++)
{
for(int k=j+1;k<n;k++)
{
if(ar[i]+ar[j]+ar[k]==target)
{
cout<<ar[i]<<","<<" β€œ<<ar[j]<<” β€œ<<β€œand”<<” "<<ar[k];
cout<<endl;
}