how to find all the combinations of numbers two at a time in c++?
I am looking for an algorithm that will take numbers and find all possible variations of them in pairs.

Example lets say the array contains :
[2,3,5]

then the result of the combination should be :

2 3

2 5

3 2

3 5

5 2

5 3


looking for a code in c++ 

how to find all the combinations of numbers two at a time in c++?
===

I am looking for an algorithm that will take numbers and find all possible variations of them in pairs.

Example lets say the array contains :
[2,3,5]

then the result of the combination should be :

2 3

2 5

3 2

3 5

5 2

5 3


looking for a code in c++ 
