Why do you want both the pairs to be printed? I guess the problem's originality is only in finding unique pairs summing to a particular number, so there's no point in printing repeating pairs. Besides, even if you want to do that, daizi's code can be altered quite simply to print repeating pairs. I guess you already are aware of the changes required in there.
~Shishir --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---