I want to print feasible solutions by adding up the maximum combinations of 2 indexes for n indexes where no index’s value can be added to itself
Expected output for 4 indexes 1,2 1,3 1,4 2,1 2,3 2,4 3,1 3,2 3,4 4,1 4,2 4,3
Where I’m going wrong :: (Here’s my Code )
for(i=1;i<n;i++)
{
for(j=1; j!=i && j<n; j++)
{
printf("%d,%d",i,j);
}
}